LaravelEvent

Summary

No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A
File
event.php
Package
Default
Class hierarchy
LaravelEvent

Tags

None found

Properties

$events

$events : array

All of the registered events.

Type

array

Tags

None found

$queued

$queued : array

The queued events waiting for flushing.

Type

array

Tags

None found

$flushers

$flushers : array

All of the registered queue flusher callbacks.

Type

array

Tags

None found

Methods

listeners()

listeners(string  $event) : boolean

Determine if an event has any registered listeners.

Parameters

string $event

Returns

boolean

static

Tags

None found

listen()

listen(string  $event, mixed  $callback) : void

Register a callback for a given event.

// Register a callback for the "start" event Event::listen('start', function() {return 'Started!';});

// Register an object instance callback for the given event
Event::listen('event', array($object, 'method'));

Parameters

string $event
mixed $callback

static

Tags

None found

override()

override(string  $event, mixed  $callback) : void

Override all callbacks for a given event with a new callback.

Parameters

string $event
mixed $callback

static

Tags

None found

queue()

queue(string  $queue, string  $key, mixed  $data = array()) : void

Add an item to an event queue for processing.

Parameters

string $queue
string $key
mixed $data

static

Tags

None found

flusher()

flusher(string  $queue, mixed  $callback) : void

Register a queue flusher callback.

Parameters

string $queue
mixed $callback

static

Tags

None found

clear()

clear(string  $event) : void

Clear all event listeners for a given event.

Parameters

string $event

static

Tags

None found

first()

first(string  $event, array  $parameters = array()) : mixed

Fire an event and return the first response.

// Fire the "start" event $response = Event::first('start');

// Fire the "start" event passing an array of parameters
$response = Event::first('start', array('Laravel', 'Framework'));

Parameters

string $event
array $parameters

Returns

mixed

static

Tags

None found

until()

until(string  $event, array  $parameters = array()) : mixed

Fire an event and return the first response.

Execution will be halted after the first valid response is found.

Parameters

string $event
array $parameters

Returns

mixed

static

Tags

None found

flush()

flush(string  $queue) : void

Flush an event queue, firing the flusher for each payload.

Parameters

string $queue

static

Tags

None found

fire()

fire(string|array  $events, array  $parameters = array(), boolean  $halt = false) : array

Fire an event so that all listeners are called.

// Fire the "start" event $responses = Event::fire('start');

// Fire the "start" event passing an array of parameters
$responses = Event::fire('start', array('Laravel', 'Framework'));

// Fire multiple events with the same parameters
$responses = Event::fire(array('start', 'loading'), $parameters);

Parameters

string|array $events
array $parameters
boolean $halt

Returns

array

static

Tags

None found