Laravel is a free, open-source PHP web framework and intended for the development of web applications following the model-view-controller(MVC) architectural pattern.

Laravel providing the Task Scheduling option. The Laravel command scheduler allows you to fluently and expressively define your command schedule within Laravel itself, and only a single Cron entry is needed on your server.

Should follow the below steps,

Set cron job in Linux for every minute. Every minute cron will check Laravel task scheduling function and call the task based on SCHEDULE_OPTION.

1. Use below command in your terminal

crontab -e

and write below line in that crontab file

* * * * * php /LARAVEL_PATH/artisan schedule:run >> /dev/null 2>&1

* * * * * command to be executed
– – – – –
| | | | |
| | | | —– Day of week (0 – 7) (Sunday=0 or 7)
| | | ——- Month (1 – 12)
| | ——— Day of month (1 – 31)
| ———– Hour (0 – 23)
————- Minute (0 – 59)

For cron schedule expressions refer this link: http://crontab.guru/

You can see your all cron job details by using below command,

crontab -l

2. Set your all task scheduler in App/Console/Kernal.php -> schedule() function

$schedule->exec(‘php artisan migrate:refresh –seed’)->SCHEDULE_OPTION();

Or

$schedule->call(function () {
DB::table(‘recent_users’)->delete();
})->SCHEDULE_OPTION();

Some schedule options:

->hourly();
->daily();
->dailyAt(’13:00′);
->weekly();
->monthly();

For more schedule options refer this link: https://laravel.com/docs/5.2/scheduling