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): void
Adds 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): void
Parameters
Parameter | Type | Description |
---|---|---|
$event | string | the fully qualified class name of the event |
clearListeners
Clear all registered listeners from the EventDispatcher.
public clearListeners(): void
dispatchQueue
Dispatch all queued events.
public dispatchQueue(?string $eventName): void
Processes 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, 06 May 2025 01:33:01 +0000