You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently there is no way to register a listener after both the model and its fiillable relations have been saved. I would like to propose something like: $model->fireHasFillableRelationsEvent('created_with_relations');
after the save method in the HasFillableRelations trait.
protected function fireHasFillableRelationsEvent($event)
{
if (! isset($this->dispatchesEvents[$event])) {
return;
}
$result = static::$dispatcher->dispatch(new $this->dispatchesEvents[$event]($this));
if (! is_null($result)) {
return $result;
}
}
The text was updated successfully, but these errors were encountered:
Let's say I have an invoice with multiple line items and I want to raise an event when the invoice and all of its line items have been saved to the database. The saved event on the invoice or on the line items will tell me if they have been saved individually but won't tell me if the complete invoice has been saved.
Currently there is no way to register a listener after both the model and its fiillable relations have been saved. I would like to propose something like:
$model->fireHasFillableRelationsEvent('created_with_relations');
after the save method in the HasFillableRelations trait.
The text was updated successfully, but these errors were encountered: