BLOG // April 28, 2022
Chain scheduled commands in Laravel
Laravel doesn't have a great way of chaining commands sequentially, but this can easily be overcome by making a single command that does the job. Lets assume you need to run "posts:import" and then "posts:publish" sequentially.
Create a new Command called PostsSchedule and put the following in the handle() function:
You can call your new posts:schedule command from Console/Kernel.php in your app folder:
And now you have posts:import run, and then posts:publish run.
Subscribe to new articles
If you enjoy my content, consider subscribing. You will only receive new blog stories, no other email.