54 lines
1.6 KiB
PHP
Executable File
54 lines
1.6 KiB
PHP
Executable File
<?php
|
|
|
|
namespace App\Console;
|
|
|
|
use App\Jobs\DeductLeaveDays;
|
|
use App\Jobs\AddMonthlyLeaveDays;
|
|
use Illuminate\Console\Scheduling\Schedule;
|
|
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
|
|
|
class Kernel extends ConsoleKernel
|
|
{
|
|
protected $commands = [
|
|
\App\Console\Commands\InitializeLeaveDaysCommand::class,
|
|
];
|
|
|
|
|
|
/**
|
|
* Define the application's command schedule.
|
|
*/
|
|
protected function schedule(Schedule $schedule): void
|
|
{
|
|
$schedule->command('clean_logs')->daily();
|
|
// Chạy command 'daily:api-call' vào mỗi ngày lúc 9h sáng
|
|
// $schedule->command('daily:api-call')
|
|
// ->dailyAt('18:00');
|
|
|
|
// Chạy command vào ngày 01/01 lúc 00:00 mỗi năm
|
|
$schedule->command('initialize:leavedays')->yearlyOn(1, 1, '00:00');
|
|
|
|
// Chạy command vào ngày 01/04 lúc 00:00 mỗi năm
|
|
$schedule->command('leave:deduct')->yearlyOn(4, 1, '00:00');
|
|
|
|
// Chạy buổi sáng lúc 12:00
|
|
$schedule->command('attendance:check S')->dailyAt('12:00');
|
|
|
|
// Chạy buổi chiều lúc 17:30
|
|
$schedule->command('attendance:check C')->dailyAt('17:30');
|
|
|
|
// Chạy vào ngày đầu tiên của mỗi tháng
|
|
$schedule->command('add:monthly-leavedays')->monthlyOn(1, '00:01');
|
|
$schedule->command('update:temporary-leavedays')->monthlyOn(1, '00:05');
|
|
}
|
|
|
|
/**
|
|
* Register the commands for the application.
|
|
*/
|
|
protected function commands(): void
|
|
{
|
|
$this->load(__DIR__ . '/Commands');
|
|
|
|
require base_path('routes/console.php');
|
|
}
|
|
}
|