Skip to content

Conversation

@barryvdh
Copy link
Contributor

Add a php artisan reload command and allow service provider to add their own commands, similar to the optimize command.

This will make it easier for services to have 1 command to add in their deployment steps, after the deployment is completed.

public function boot()
{
    $this->reloads('reverb:restart');
}

It adds the queue command by default, because that command is added by the core. Horizon could perhaps register it on the same 'queue' key to avoid reloading. Services like Pulse, Reverb etc could hook into this similarly.

Alternative for #51993

@taylorotwell
Copy link
Member

I like this idea 👀

@taylorotwell taylorotwell merged commit 6ef7343 into laravel:12.x Nov 28, 2025
74 checks passed
@taylorotwell
Copy link
Member

@barryvdh do you have time to send a PR to Horizon, Octane, and Reverb for this? 👀

@barryvdh
Copy link
Contributor Author

I can take a look, but do you want me to bump the requirement, or add a version/method check?

@barryvdh
Copy link
Contributor Author

Horizon: laravel/horizon#1671
Pulse: laravel/pulse#469
Reverb: laravel/reverb#355
Octane: laravel/octane#1081

@barryvdh barryvdh deleted the feat-reload-command branch November 28, 2025 19:49
@francoism90
Copy link

This is also very useful for development. Horizon for example needs a restart after making queue (jobs) changes and you want to test that locally.

@decadence
Copy link
Contributor

Shouldn't schedule:interrupt be added to the default list?

@barryvdh
Copy link
Contributor Author

barryvdh commented Dec 3, 2025

Shouldn't schedule:interrupt be added to the default list?

I was not aware of the command, but yes I think so.

@rodrigopedra
Copy link
Contributor

Shouldn't schedule:interrupt be added to the default list?

I don't think so.

Most scheduled tasks spawn separate artisan tasks, which will pick up any changes already.

Interrupting a schedule cycle doesn't "release" these tasks on a sort of queue, so some tasks would only run again on their next cycle, be it daily, monthly, or whatever.

When a user runs schedule:interrupt manually or manually adds this command to their deployment script, they are well aware of the consequences and can mitigate them consciously.

Adding it as an automatic side effect of the reload command could overshadow these caveats.

@decadence
Copy link
Contributor

decadence commented Dec 3, 2025

It's for Interrupting Sub-Minute Tasks.

Otherwise, an instance of the schedule:run command that is already running would continue using your application's previously deployed code until the current minute ends.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants