PHP code example of mirzabusatlic / laravel-schedule-monitor

1. Go to this page and download the library: Download mirzabusatlic/laravel-schedule-monitor library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mirzabusatlic / laravel-schedule-monitor example snippets




namespace App\Console;

use Busatlic\ScheduleMonitor\MonitorsSchedule;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    use MonitorsSchedule;

    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        \App\Console\Commands\DeleteFilesCommand::class,
        \App\Console\Commands\FlushEventsCommand::class,
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule $schedule
     *
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        $schedule->command('files:delete')->dailyAt('00:05');
        
        $schedule->command('events:flush')->hourly();

        $this->monitor($schedule);
    }
}