2025-12-02 17:32:52 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Console;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Console\Scheduling\Schedule;
|
|
|
|
|
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
|
|
|
|
|
|
|
|
|
class Kernel extends ConsoleKernel
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Register the Artisan commands for the application.
|
|
|
|
|
*
|
|
|
|
|
* @var array
|
|
|
|
|
*/
|
|
|
|
|
protected $commands = [
|
|
|
|
|
\App\Console\Commands\CaldavSyncCommand::class,
|
2026-03-05 10:42:40 +01:00
|
|
|
\App\Console\Commands\CheckInvoiceDueDatesCommand::class,
|
2025-12-02 17:32:52 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Define the application's command schedule.
|
|
|
|
|
*/
|
|
|
|
|
protected function schedule(Schedule $schedule): void
|
|
|
|
|
{
|
2026-03-05 10:42:40 +01:00
|
|
|
$schedule->command('caldav:sync')
|
|
|
|
|
->everyMinute()
|
|
|
|
|
->withoutOverlapping();
|
|
|
|
|
|
|
|
|
|
// Run synchronously on schedule to support environments without queue workers
|
|
|
|
|
$schedule->command('invoices:check-due')
|
|
|
|
|
->dailyAt('3:00')
|
|
|
|
|
->withoutOverlapping();
|
2025-12-02 17:32:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Register the commands for the application.
|
|
|
|
|
*/
|
|
|
|
|
protected function commands(): void
|
|
|
|
|
{
|
|
|
|
|
$this->load(__DIR__ . '/Commands');
|
|
|
|
|
|
|
|
|
|
require base_path('routes/console.php');
|
|
|
|
|
}
|
2026-03-05 10:42:40 +01:00
|
|
|
}
|