Skip to content
Discussion options

You must be logged in to vote

In my models I register a deleting listener:

    /**
     * Delete media collections on Delete
     */
    protected static function boot()
    {
        parent::boot();

        static::deleting(function (MyModel $myModel) {
            $myModel->clearMediaCollection('images');
            return $myModel;
        });
    }

or just call clearMediaCollection directly.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by freekmurze
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants