Category: Laravel, PHP

Hello friends, today I will show you how to set cron jobs or task scheduling in a Laravel and Lumen (a micro-framework of Laravel) application.

All your jobs or tasks will be defined in the schedule method under app/Console/Kernel.php file.

Configuration: To register this package in your application please add the following code in your bootstrap/app.php file.

Once you open the file it will look like below: Here the value of $signature would be the name of your command for the task you are going to run and it could be anything.

As per my example, my script would look like below: Once you have done this you need to register your command in the Kernel file which is located in app/Console/Kernel.php.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners