Answers for "Laravel Scheduler"

PHP
1

laravel scheduler run

php artisan schedule:list
php artisan schedule:run
Posted by: Guest on May-08-2021
0

test laravel scheduler

Set the cron to run after every minute:
* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
  
Then inisde you kernel.php
//For every minute
$schedule->call(function () {
	Log::info('I ran after every 1 minute');
})->everyMinute();
//For every five minute
$schedule->call(function () {
	Log::info('I ran after every 5 minute');
})->everyFiveMinutes();
Posted by: Guest on December-12-2020
2

Laravel Scheduler

$schedule->call(function () {
            DB::table('users')->whereYear('last_login_at','<',date('Y')-1)->delete();
        })->daily();
Posted by: Guest on May-10-2020
0

laravel run schedule locally

php artisan schedule:work
Posted by: Guest on October-05-2021

Browse Popular Code Answers by Language