Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with model events #26

Open
Himalayjp opened this issue Oct 18, 2016 · 3 comments
Open

Not working with model events #26

Himalayjp opened this issue Oct 18, 2016 · 3 comments

Comments

@Himalayjp
Copy link

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..

@Temepest74
Copy link
Contributor

i get no update from the mete values :))) Now, when the updated event is called, my model has no meta fields filled.

@kodeine
Copy link
Owner

kodeine commented Sep 9, 2021

Can you submit a PR?

@Temepest74
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants