This is very odd, because the process for creating a model is still the same here. Can you show us how you store the post to the database in your listener?
Observer not triggering from a running job.
Hi all, I have a model. class Post, and when I use Post::create([]) I have an observer successfully triggering it's created method.
I have the Observer set up in the AppServiceProvider boot() method. \App\Models\Post::observe(\App\Observers\PostObserver::class);
This has been working for over a year now so no worries in that. However I decided to move the creation of said Post to a job. So now php artisan queue:work --queue=myqueue is running, and I can fire off the job and watch it spit out debugs in the command line.
*I can see my Post is being created in the database, but for some reason the Observer is not triggering. Literally nothing has changed in the set up of the Observer, merely the location of where I create the job.
Has anybody encountered this before?
Please or to participate in this conversation.