class EventHandler

Properties

static protected array<class-string, string> $eventHandlerMap

Map event handlers to events.

static protected array<class-string, string> $authEventHandlerMap

Map authentication event handlers to events.

Methods

__construct(Container $container, array $config)

Create a new event handler instance.

void
subscribe(Dispatcher $dispatcher)

Attach all event handlers.

void
subscribeAuthEvents(Dispatcher $dispatcher)

Attach all authentication event handlers.

void
__call(string $method, array $arguments)

Pass through the event and capture any errors.

void
routeMatchedHandler(RouteMatched $match)

Handle a route matched event.

void
queryExecutedHandler(QueryExecuted $query)

Handle a SQL query executed event.

void
transactionEventHandler(TransactionBeginning|TransactionCommitted|TransactionRolledBack $event)

Handle a SQL transaction event (begin, commit, rollback).

void
messageLoggedHandler(MessageLogged $logEntry)

Handle a message logged event.

void
authenticatedHandler(Authenticated $event)

Handle an authenticated event.

void
sanctumTokenAuthenticatedHandler(TokenAuthenticated $event)

Handle a Sanctum token authenticated event.

Details

at line 58
__construct(Container $container, array $config)

Create a new event handler instance.

Parameters

Container $container
array $config

at line 71
void subscribe(Dispatcher $dispatcher)

Attach all event handlers.

Parameters

Dispatcher $dispatcher

Return Value

void

at line 95
void subscribeAuthEvents(Dispatcher $dispatcher)

Attach all authentication event handlers.

Parameters

Dispatcher $dispatcher

Return Value

void

at line 105
void __call(string $method, array $arguments)

Pass through the event and capture any errors.

Parameters

string $method
array $arguments

Return Value

void

at line 123
protected void routeMatchedHandler(RouteMatched $match)

Handle a route matched event.

Parameters

RouteMatched $match

Return Value

void

at line 142
protected void queryExecutedHandler(QueryExecuted $query)

Handle a SQL query executed event.

Parameters

QueryExecuted $query

Return Value

void

at line 166
protected void transactionEventHandler(TransactionBeginning|TransactionCommitted|TransactionRolledBack $event)

Handle a SQL transaction event (begin, commit, rollback).

at line 181
protected void messageLoggedHandler(MessageLogged $logEntry)

Handle a message logged event.

Parameters

MessageLogged $logEntry

Return Value

void

at line 195
protected void authenticatedHandler(Authenticated $event)

Handle an authenticated event.

Parameters

Authenticated $event

Return Value

void

at line 203
protected void sanctumTokenAuthenticatedHandler(TokenAuthenticated $event)

Handle a Sanctum token authenticated event.

Parameters

TokenAuthenticated $event

Return Value

void