Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
50.00% covered (danger)
50.00%
1 / 2
CRAP
12.50% covered (danger)
12.50%
3 / 24
Kernel
0.00% covered (danger)
0.00%
0 / 1
50.00% covered (danger)
50.00%
1 / 2
4.68
12.50% covered (danger)
12.50%
3 / 24
 schedule
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 21
 commands
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
3 / 3
<?php
namespace App\Console;
use App\Models\AttendanceRequests\UserAttendanceRequests;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        //
    ];
    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    // Schedule commands
    protected function schedule(Schedule $schedule)
    {
        $schedule->command('cache:clear')->timezone(Config('settings.time_zone'))->everySecond();
        $schedule->command('updateLeave:carryForward2021')->timezone(Config('settings.time_zone'))->yearly();
       // $schedule->command('updateLeave:carryForward')->timezone(Config('settings.time_zone'))->yearly();
       $schedule->command('updateLeave:monthlyCarryForwardNone')->timezone(Config('settings.time_zone'))->monthly();
        $schedule->command('monthly:notifications')->timezone(Config('settings.time_zone'))->monthly();
        $schedule->command('updateLeave:advance')->timezone(Config('settings.time_zone'))->yearly();
        $schedule->command('updateLeave:prorata')->timezone(Config('settings.time_zone'))->monthly();
        $schedule->command('updateLeave:quarterly')->timezone(Config('settings.time_zone'))->quarterly();
        $schedule->command('updateLeave:semiyearly')->timezone(Config('settings.time_zone'))->cron('0 0 1 */6 *');
       // $schedule->command('leaves:update')->timezone(Config('settings.time_zone'))->monthly();
       // $schedule->command('advanceleaves:update')->timezone(Config('settings.time_zone'))->yearly();
        $schedule->command('send:attendanceNotifications')->timezone(Config('settings.time_zone'))->everyThirtyMinutes();
        $schedule->command('birthday:notifications')->timezone(Config('settings.time_zone'))->dailyAt('9:00');
        $schedule->command('reminder:notifications')->timezone(Config('settings.time_zone'))->dailyAt('9:00');
        $schedule->command('create:UserWeeklyOff')->timezone(Config('settings.time_zone'))->dailyAt('00:00');
        $schedule->command('create:UserDailyOnOff')->timezone(Config('settings.time_zone'))->dailyAt('00:00');
        $schedule->command('compOff:automatic')->timezone(Config('settings.time_zone'))->dailyAt('9:00');
        $schedule->command('compOff:semiAutomatic')->timezone(Config('settings.time_zone'))->dailyAt('9:00');
        $schedule->command('compOff:addLeaveBalanceForFutureDates')->timezone(Config('settings.time_zone'))->dailyAt('9:00');
        $schedule->command('compOff:lapseUnutilizedLeaves')->timezone(Config('settings.time_zone'))->dailyAt('9:00');
        $schedule->command('attendance:process')->timezone(Config('settings.time_zone'))->dailyAt('00:00');
        ///added the code
        //to update the value of attendance freq to 0 on first of every month
        $schedule->call(function () {
            UserAttendanceRequests::query()->update(['attendance_freq'=> 0]);
        })->monthlyOn(1, '00:00');
    }
    /**
     * Register the commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        $this->load(__DIR__.'/Commands');
        require base_path('routes/console.php');
    }
}