Files
Kol-Manager/routes/console.php

21 lines
679 B
PHP

<?php
use App\Services\NotificationDispatcher;
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('notifications:dispatch', function () {
/** @var NotificationDispatcher $dispatcher */
$dispatcher = app(NotificationDispatcher::class);
$dispatcher->dispatchAll();
$this->info('🔔 Notifications dispatched.');
})->purpose('Send all pending Cathy notifications');
// Run every hour automatically
Schedule::command('notifications:dispatch')->hourly();