framework
framework copied to clipboard
Child model events not triggering
I think I've found a bug within model events.
When calling $modelA->modelB()->update(), the updating event within modelB is not triggered but modelA's is called.
Can you post some real code?
Of course! My bad.
$user->profile()->update(array( 'foo' => 'bar' ));
That code is actually triggering the Model Event updating in User Model, instead of Profile Model.
Note: No model events are fired when updating a set of models via the Eloquent query builder.