Laravel - Events - Dispatching Events
To dispatch an event, you may call the static
dispatch method on the event. This method is made available on the event by the
Illuminate\Foundation\Events\Dispatchable trait. Any arguments passed to the
dispatch method will be passed to the event's constructor:
order_id); // Order shipment logic... OrderShipped::dispatch($order); } }
When testing, it can be helpful to assert that certain events were dispatched without actually triggering their listeners. Laravel's built-in testing helpers makes it a cinch.