Open aneeshsudhakaran opened 8 years ago
Step 1 : Create php artisan make:command { CronFileName} --command={cron:name} Eg: php artisan make:command StoreDealemail --command=storedeal:email
Step 2 : Open app\Console\Commands{CronFileName} Update : app\Console\Commands{CronFileName} `protected $signature ={cron:name} // same as {cron:name}
protected $description ={Description }; // Description about cron public function handle() { // Write Code here } `
Step 3 :Open app\Console\kernel.php
add protected $commands = [ // Commands\{CronClasName}::class, ];
protected function schedule(Schedule $schedule) { // $schedule->command('inspire') // ->hourly(); $schedule->command('storedeal:email')->daily(); // add cron command with interval }
Step 4 : Test Conjob
Run : php artisan {cron:name}
eg: php artisan storedeal:email
How we can create Cronjob in Laravel 5.3