Command hooks #48898
-
Hello everyone. IntroductionRecently I had to do an optimization in my project. I can create a artisan command for this specific task, but then I will have to remember to run it alongside IdeaI thinks it would be cool to be able to subscribe to artisan commands through robust laravel Event system. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Have you tried this? use Illuminate\Console\Events\CommandFinished;
use Illuminate\Support\Facades\Event;
Event::listen(function (CommandFinished $event) {
if ($event->command === 'optimize') {
//
}
}); |
Beta Was this translation helpful? Give feedback.
Have you tried this?