observer not triggered from EditAction
I have this editaction in a relationsmanager it's updating correctly the pivot attributes but not triggering an updating() observer
16 Replies
You have an Pivot model and an observer for that one?!
yes
And you registered the Observer for the model?
yes the observer works on save() and update() via a route
but on the attachaction and editaction it isnt triggered
Did you check, whether the
->using()
method is triggered and whether the pivot is an instance of your model?yes the using() works and updates the ingredient_recipe pivot table
And is the pivot an instance of your PivotModel?
yes
I mean the pivot. Not the model.
dd($record->pivot)
should be IngredientRecipe
Yeah. That’s the issue. It isn’t using your model. Not sure whether that’s configurable on the filament side.
any work around idea?
Can you share your Model class with the relevant relationship declaration?
Not sure how this works without Filament, but you should update the relation to use the Pivot Model: https://laravel.com/docs/master/eloquent-relationships#defining-custom-intermediate-table-models
thanks for the tips!