laravel-meta
laravel-meta copied to clipboard
Not working with model events
If you are using laravel events https://laravel.com/docs/5.2/eloquent#events with metable in model, While creating or updating the record model event is executing twice as metable is updating the record with metafield once the record has been saved using model eloquent..
i get no update from the mete values :))) Now, when the updated event is called, my model has no meta fields filled.
Can you submit a PR?
After a lot of debuging, I found out that my problem had something to do with laravel... Idk how but I found a workaround. My issue was: when I fire an event from the booted model function (static::saved) I will be able to assign the new value of the model to a global variable, but inside the broadcastWith function, I will not get the new value (but the old one). Idk what causes this, but if I dispatch my event with event::dispatch it works like a charm