Skip to main content

Overview

Unleash Commerce uses observers to provide behavior that should always happen to models. For example, the UserObserver automatically removes roles and permissions when a user is deleted, ensuring data consistency without requiring manual cleanup.

Creating an Observer

Create an observer class and implement the observer contract for your model:

Replacing an Observer

Replace a default observer with your custom implementation in a service provider:

Disabling an Observer

Disable an observer entirely without replacing it in a service provider:

Existing Observers

The core package includes the following observers: