A kill switch—sometimes known as a https://en.wikipedia.org/wiki/Dead_man%27s_switch—is a type of safety mechanism common in machinery that interrupts a process in the event of an emergency. In this case, the drill trigger serves as a kill switch; if the operator becomes incapacitated, the drill will instantly stop (or be “killed”).

Here’s how we could implement this: class DeliveryRequest extends Model public function biker(): BelongsTo return $this->belongsTo(Biker::class); public function startBikerMatchFinder() $this->markAsFindingNearbyBikers(); NotifyBikers::dispatch($this); // This is a Kill Switch.

// public function handle() if ($this->deliveryRequest->hasEndedMatching()) { return; $this->deliveryRequest->markAsFindingAllBikers(); class NotifyBikers public function __construct(public DeliveryRequest $deliveryRequest)

This delivery app example shows us how we can apply our kill switch concept to activate a wider search for bikers.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners