R
R
Raccoon2019-11-21 11:27:31
Laravel
Raccoon, 2019-11-21 11:27:31

Why doesn't Laravel Observer fire when changing model in console command?

I have an Observer that I use to log model related changes. When working via the web, everything works fine, but when the model is changed in the Observer console command, it does not work.
Model::observe(ModelObserver::class) is included in the boot() method of the AppServiceProvider.
Maybe it needs to be written somewhere else?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Raccoon, 2019-12-05
@antonov22

The problem was that the project had a lib that blocked the emission of Eloquent events for console commands.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question