jahondust / model-log

Voyager Model Log
28 stars 15 forks source link

[Question] How to dispatch events to log actions ? #5

Closed pastanislas closed 4 years ago

pastanislas commented 4 years ago

Hello, sorry if this is obvious I'm new to laravel and voyager. I'm trying to use model-log to log (eh !) but I'm facing issue when using a custom controller with a save action on the model. Ie : Changing the model with Voyager bread -> works as expected Changing the model with myCustomController() [..] $myModel->save() doesn't update model-log table.

I've tryed to dispatch events event(new BreadDataUpdated($dataType, $myModel)) but without success. Could you point me to the right direction ? Thanks.

pastanislas commented 4 years ago

OK everything is working fine, I wasn't saving the model, but updating it. ie: update($query) and this doesn't trigger save events. Thanks for your work