I have a laravel project, and I need to make some calculations immediately after I save a model and attach some data to it.
在调用attach(或detach/sync)后,是否在laravel中触发了任何事件?
I have a laravel project, and I need to make some calculations immediately after I save a model and attach some data to it.
在调用attach(或detach/sync)后,是否在laravel中触发了任何事件?
Laravel 5.8 now fires events on ->attach()
Check out: https://laravel.com/docs/5.8/releases
And search for: Intermediate Table / Pivot Model Events
https://laracasts.com/discuss/channels/eloquent/eloquent-attach-which-event-is-fired?page=1