Support the ongoing development of Laravel.io →
posted 9 years ago
Eloquent
Last updated 2 years ago.
0

I found a workaround for my own problem. As it looked like the dispatcher was not set in time inside my model i decided to set it myself.

I found that workaround quite dirty but it works. Again model events works fine on all other models in my app.

 public static function boot(){
            parent::boot();
            
            User::setEventDispatcher(App()['events']);

            User::updated(function($user){
                          //some code
            });
 }           
Last updated 2 years ago.
0

did you found anything about this? i have the same problem, and the workaround worked perfectly

0

Sign in to participate in this thread!

Eventy

Your banner here too?

elfif elfif Joined 7 Apr 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.