Replies: 1 comment
-
Solution in a service provider: use Illuminate\Console\Events\CommandFinished;
use Illuminate\Contracts\Console\Kernel;
..
$this->app->make('events')->listen(CommandFinished::class, function ($event) {
if ($event->command == 'stub:publish') {
$this->app->make(Kernel::class)->queue('mycommand:here');
}
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The stub publish command currently sits outside of
vendor:publish
so third party packages that provide customisable stubs can't hook into it.Originally I had considered adding an event to the
stub:publish
command that collects an array of stubs, but would it not be better to have this has a group on the vendor publish command?I don't see a reason why the default Laravel behaviour couldn't make use of the
publishes()
method in the service providers. This would make it easier for third-party packages to use, as well as letting each individual Laravel components provide its own stubs, rather than having them in one big array.Beta Was this translation helpful? Give feedback.
All reactions