Skip to content

Idea: Raise custom event after save method #14

@eporsche

Description

@eporsche

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;
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions