Methods summary
public static
boolean
|
#
listeners( string $event )
Determine if an event has any registered listeners.
Determine if an event has any registered listeners.
Parameters
Returns
boolean
|
public static
|
#
listen( string $event, mixed $callback )
Register a callback for a given event.
Register a callback for a given event.
Event::listen('start', function() {return 'Started!';});
Event::listen('event', array($object, 'method'));
Parameters
- $event
string $event
- $callback
mixed $callback
|
public static
|
#
override( string $event, mixed $callback )
Override all callbacks for a given event with a new callback.
Override all callbacks for a given event with a new callback.
Parameters
- $event
string $event
- $callback
mixed $callback
|
public static
|
#
queue( string $queue, string $key, mixed $data = array() )
Add an item to an event queue for processing.
Add an item to an event queue for processing.
Parameters
- $queue
string $queue
- $key
string $key
- $data
mixed $data
|
public static
|
#
flusher( string $queue, mixed $callback )
Register a queue flusher callback.
Register a queue flusher callback.
Parameters
- $queue
string $queue
- $callback
mixed $callback
|
public static
|
#
clear( string $event )
Clear all event listeners for a given event.
Clear all event listeners for a given event.
Parameters
|
public static
mixed
|
#
first( string $event, array $parameters = array() )
Fire an event and return the first response.
Fire an event and return the first response.
$response = Event::first('start');
$response = Event::first('start', array('Laravel', 'Framework'));
Parameters
- $event
string $event
- $parameters
array $parameters
Returns
mixed
|
public static
mixed
|
#
until( string $event, array $parameters = array() )
Fire an event and return the first response.
Fire an event and return the first response.
Execution will be halted after the first valid response is found.
Parameters
- $event
string $event
- $parameters
array $parameters
Returns
mixed
|
public static
|
#
flush( string $queue )
Flush an event queue, firing the flusher for each payload.
Flush an event queue, firing the flusher for each payload.
Parameters
|
public static
array
|
#
fire( string|array $events, array $parameters = array(), boolean $halt = false )
Fire an event so that all listeners are called.
Fire an event so that all listeners are called.
$responses = Event::fire('start');
$responses = Event::fire('start', array('Laravel', 'Framework'));
$responses = Event::fire(array('start', 'loading'), $parameters);
Parameters
- $events
string|array $events
- $parameters
array $parameters
- $halt
boolean $halt
Returns
array
|