Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

CliffordAtCaveoDotNL's avatar

Nova, observer, deleted and forceDeleted events

I have an observer for a model listening for the deleted and forceDeleted events (triggering an api call by a queued job).

When I (soft)delete the model in Nova the deleted event is fired, but when the model is being forceDeleted in Nova both the deleted and the forceDeleted events are fired.

Anyone had this before? And how did you fixed it?

0 likes
3 replies
mvdnbrk's avatar
mvdnbrk
Best Answer
Level 22

I think this has nothing to do with Nova. When you force delete a model Laravel will fire a deleted event and a forceDeleted event.

CliffordAtCaveoDotNL's avatar

I think you are totally right:

    /**
     * Force a hard delete on a soft deleted model.
     *
     * @return bool|null
     */
    public function forceDelete()
    {
        $this->forceDeleting = true;

        return tap($this->delete(), function ($deleted) {
            $this->forceDeleting = false;

            if ($deleted) {
                $this->fireModelEvent('forceDeleted', false);
            }
        });
    }
mvdnbrk's avatar

So you could listen for the deleting event and check if it s force deleting by checking $model->isForceDeleting()

Please or to participate in this conversation.