How Do I
Check a notification
Ask the gate whether a notification can use a channel before sending it.
Use the notifiable trait when application code needs to make the decision explicitly:
$allowed = $user->canReceiveNotification(
$notification,
'mail',
);
NotificationCompass also listens to Laravel's NotificationSending event. Registered notifications are stopped when their channel is unavailable, their required context is missing, their context is unsupported, or their effective preference is disabled. Unknown notifications follow the configured unknown_notifications behavior: they are allowed by default, denied with an explicit decision in deny mode, or raise a LogicException in throw mode.
Use NotificationGate::decision() when you need the resolved reason instead of only a boolean result. The returned NotificationDecisionReason can be logged or matched in backend tests.