Where-in-the-World-is-Ben/app/Console/Kernel.php
2024-02-18 10:35:46 +00:00

56 lines
1.5 KiB
PHP

<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use Illuminate\Support\Facades\Log;
class Kernel extends ConsoleKernel
{
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
$schedule->command('digest:send --daily')
->daily()
->onFailure(function () {
Log::error("Daily email digest send failed");
});
$schedule->command('digest:send --weekly')
->weekly()
->fridays()
->onFailure(function () {
Log::error("Weekly email digest send failed");
});
$schedule->command('digest:send --fortnightly')
->twiceMonthly(1,16,'13:00')
->onFailure(function () {
Log::error("Fortnightly email digest send failed");
});
$schedule->command('digest:send --monthly')
->monthlyOn(16, "13:00")
->onFailure(function () {
Log::error("Monthly email digest send failed");
});
}
/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}