Where-in-the-World-is-Ben/app/Console/Kernel.php

57 lines
1.5 KiB
PHP
Raw Normal View History

2022-08-23 19:11:43 +00:00
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
2022-11-02 17:39:49 +00:00
use Illuminate\Support\Facades\Log;
2022-08-23 19:11:43 +00:00
class Kernel extends ConsoleKernel
{
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
2022-11-02 17:39:49 +00:00
$schedule->command('digest:send --daily')
->daily()
2022-11-30 18:47:09 +00:00
->onFailure(function () {
2022-11-02 17:39:49 +00:00
Log::error("Daily email digest send failed");
});
$schedule->command('digest:send --weekly')
->weekly()
2024-02-18 10:35:46 +00:00
->fridays()
2022-11-30 18:47:09 +00:00
->onFailure(function () {
2022-11-02 17:39:49 +00:00
Log::error("Weekly email digest send failed");
});
2022-11-07 22:33:46 +00:00
$schedule->command('digest:send --fortnightly')
2024-03-14 18:31:28 +00:00
->twiceMonthly(1, 16, '13:00')
2022-11-30 18:47:09 +00:00
->onFailure(function () {
2022-11-07 22:33:46 +00:00
Log::error("Fortnightly email digest send failed");
});
2022-11-02 17:39:49 +00:00
$schedule->command('digest:send --monthly')
2024-02-18 10:35:46 +00:00
->monthlyOn(16, "13:00")
2022-11-30 18:47:09 +00:00
->onFailure(function () {
2022-11-02 17:39:49 +00:00
Log::error("Monthly email digest send failed");
});
2022-08-23 19:11:43 +00:00
}
/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}