44 خطوط
1.7 KiB
PHP
44 خطوط
1.7 KiB
PHP
<?php
|
|
|
|
use App\Services\FollowUpReminderService;
|
|
use App\Services\LegacyCallNoteBackfillService;
|
|
use App\Services\SlaMonitorService;
|
|
use App\Services\TaskReminderService;
|
|
use Database\Seeders\RolePermissionSeeder;
|
|
use Illuminate\Foundation\Inspiring;
|
|
use Illuminate\Support\Facades\Artisan;
|
|
use Illuminate\Support\Facades\Schedule;
|
|
|
|
Artisan::command('inspire', function () {
|
|
$this->comment(Inspiring::quote());
|
|
})->purpose('Display an inspiring quote');
|
|
|
|
Artisan::command('permissions:sync-defaults', function (RolePermissionSeeder $seeder) {
|
|
$seeder->run();
|
|
$this->info('Default CRM roles and permissions were synchronized.');
|
|
})->purpose('Create missing permissions and synchronize the default role matrix');
|
|
|
|
Artisan::command('call-notes:backfill', function (LegacyCallNoteBackfillService $service) {
|
|
$created = $service->run();
|
|
$this->info("{$created} legacy call notes were backfilled.");
|
|
})->purpose('Idempotently backfill calls.notes into polymorphic note history');
|
|
|
|
Artisan::command('sla:monitor', function (SlaMonitorService $service) {
|
|
$this->info($service->run().' new SLA warnings or breaches created.');
|
|
})->purpose('Idempotently detect and notify CRM SLA warnings and breaches');
|
|
|
|
Schedule::call(fn () => app(FollowUpReminderService::class)->sendDueReminders())
|
|
->name('follow-up-reminders')
|
|
->everyFifteenMinutes()
|
|
->withoutOverlapping();
|
|
|
|
Schedule::call(fn () => app(TaskReminderService::class)->sendDueNotifications())
|
|
->name('task-reminders')
|
|
->everyMinute()
|
|
->withoutOverlapping();
|
|
|
|
Schedule::call(fn () => app(SlaMonitorService::class)->run())
|
|
->name('sla-monitor')
|
|
->everyFifteenMinutes()
|
|
->withoutOverlapping();
|