Skip to main content

Overview

Opscale\NotificationCenter\Nova\Actions\ForceDelivery is a Laravel Nova action available on the Delivery resource detail view. It immediately re-sends a notification to the delivery’s profile on the delivery’s configured channel, skipping all scheduling windows, timeout checks, and status gate-keeping that ExecuteNotificationStrategy normally enforces.
use Opscale\NotificationCenter\Nova\Actions\ForceDelivery;

Class signature

class ForceDelivery extends Action
{
    use InteractsWithQueue, Queueable;

    public bool $onlyOnDetail = true;

    public function name(): string;

    public function handle(ActionFields $fields, Collection $models): mixed;

    public function fields(NovaRequest $request): array;
}

Availability

PropertyValue
$onlyOnDetailtrue — only visible on the Delivery detail page
ResourceDelivery
FieldsNone — no form fields required

What happens when the action runs

1

Resolve the channel message class

For each selected Delivery model the action reads the channel and looks it up in config('notification-center.messages'):
$channel   = $delivery->channel;
$messages  = config('notification-center.messages', []);
If no notification class is configured for that channel, the action returns an error immediately:
return Action::danger(
    __('No notification class configured for channel: :channel',
        ['channel' => $channel])
);
2

Resolve the profile

The profile is loaded from the delivery relationship:
$profile = $delivery->profile;
If the profile cannot be found the action returns an error:
return Action::danger(__('Profile not found for this delivery.'));
3

Send immediately

The notification class is instantiated with the existing Delivery model and sent via notify() — bypassing queues, time windows, and the hourly scheduler:
$profile->notify(new $notificationClass($delivery));
4

Confirm success

A success message is returned to the Nova UI:
return Action::message(__('Notification(s) sent successfully!'));

handle method signature

public function handle(ActionFields $fields, Collection $models): mixed
fields
ActionFields
required
The submitted form fields. ForceDelivery defines no fields, so this object is empty.
models
Illuminate\Support\Collection
required
The collection of Delivery models to force-send. Each delivery is processed individually in sequence; an error on one delivery halts processing of subsequent ones and returns a danger response.

What it bypasses

Normal constraintBypassed?
Strategy time window (days / hours)Yes
Channel timeout (timeout_per_channel)Yes
Delivery status guards (OPENED, VERIFIED)Yes
Hourly schedulerYes
Queue delay / retry_intervalYes
max_attempts limitYes
Force-delivering a notification that is already in a terminal status (OPENED, VERIFIED, FAILED, EXPIRED) will send it again but will not reset the delivery status. The TrackEvent listener may log a status-transition warning if the resulting SENT event is invalid for the current status.

When to use ForceDelivery

  • Debugging — verify that a channel integration is working correctly without waiting for the scheduler.
  • Resending failed deliveries — when a delivery has status FAILED due to a transient provider error and you want to retry immediately without creating a new Delivery record.
  • Time-sensitive situations — when a scheduled delivery has not fired yet but the recipient needs the notification right now.
  • Testing webhooks or receipt tracking — trigger a real send to observe downstream event tracking.

Usage in Nova

Register the action on your Delivery Nova resource:
use Opscale\NotificationCenter\Nova\Actions\ForceDelivery;

public function actions(NovaRequest $request): array
{
    return [
        new ForceDelivery(),
    ];
}
The action appears in the Actions dropdown on the delivery detail page. Click Force Delivery — no form fields are shown — and confirm to send immediately.
Because $onlyOnDetail is true, ForceDelivery does not appear in bulk-action menus on the delivery index. You must navigate to an individual delivery’s detail view to trigger it.
Pair ForceDelivery with the delivery status filters in Nova to quickly find all Failed deliveries and re-trigger them one by one during an incident.

Build docs developers (and LLMs) love