Category: Laravel, Laravel

Ever needed to schedule an `artisan` command from one of your Laravel packages but couldn't figure out how to do it? Before you can run your command on the scheduler, you need to make sure you've actually registered the command with artisan. To do this, use the $this->commands method in your ServiceProvider::boot method. By doing this, you can now run your command using php artisan my-awesome-command. Now that artisan is aware of your command, you can hook it up to Laravel's Schedule and run it as often as you need.
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