PHP code example of trogers1884 / laravel-schedule-mgt

1. Go to this page and download the library: Download trogers1884/laravel-schedule-mgt 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/ */

    

trogers1884 / laravel-schedule-mgt example snippets


return [
    'storage_path' => storage_path('app/schedule-mgt'),
    'file_format' => 'json',
];

use Trogers1884\LaravelScheduleMgt\ScheduleManager;

ScheduleManager::schedule();

use Trogers1884\LaravelScheduleMgt\ScheduleManager;

protected function schedule(Schedule $schedule)
{
    ScheduleManager::schedule();
}

  'providers' => [
      // ...
      Trogers1884\LaravelScheduleMgt\ScheduleMgtServiceProvider::class,
  ],
  
bash
php artisan vendor:publish --tag="schedule-mgt-config"
bash
php artisan schedule:list
bash
php artisan schedule:toggle 1 --active=0
bash
php artisan schedule:remove 1
bash
php artisan schedule:add "cache:clear" --frequency=daily
bash
php artisan schedule:add "backup:run" \
    --frequency=weekly \
    --freq-parameters='["monday", "3:00"]' \
    --parameters='["--only-db"]' \
    --constraints='[{"method":"environments", "parameters":["production"]}]'
bash
rm config/schedule-mgt.php