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

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners