Event
Less than 1 minute
Event
Class Event.
Provides static methods to interact with the event dispatching system. This acts as a facade for the EventDispatcher singleton instance.
Methods
listen
Register an event listener.
public listen(object $listener): voidAdds a listener object to the EventDispatcher. The listener object should have a handle method that accepts the event object as its first parameter.
Parameters
| Parameter | Type | Description |
|---|---|---|
$listener | object | the listener object to register |
getListeners
Get all listeners registered for a specific event.
public getListeners(string $event): voidParameters
| Parameter | Type | Description |
|---|---|---|
$event | string | the fully qualified class name of the event |
clearListeners
Clear all registered listeners from the EventDispatcher.
public clearListeners(): voiddispatchQueue
Dispatch all queued events.
public dispatchQueue(?string $eventName): voidProcesses and executes the handle method for all listeners associated with events that were marked as Queuable and deferred.
Parameters
| Parameter | Type | Description |
|---|---|---|
$eventName | string |
Generated by Hazaar API Doc Generator on Tue, 30 Sep 2025 00:01:37 +0000