8000 Events · rydurham/Sentinel Wiki · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Ryan Durham edited this page Jun 13, 2014 · 9 revisions

Sentinel triggers events when certain actions are taken - you can extend the package's behaviour by setting up your own event listeners to provide custom functionality.

These are the events triggered by Sentinel:

Event Name Available Data
sentinel.user.login Full User Object
sentinel.user.logout
sentinel.user.registered Full User Object
sentinel.user.updated Full User Object
sentinel.user.destroyed userId
sentinel.user.activated userId
sentinel.user.resend userId, email, activationCode
sentinel.user.forgot userId, email, resetCode
sentinel.user.newpassword email, newPassword
sentinel.user.passwordchange userId
sentinel.user.suspended userId
sentinel.user.unsuspended userId
sentinel.user.banned userId
sentinel.group.created
sentinel.group.updated groupId
sentinel.group.destroyed groupId

Default Listeners:

As of version 1.4, Sentinel has these built in listeners. They can be deactivated by creating another listener with a higher priority that returns false.

User Mailer Event Listeners

$events->listen('user.register',    'Sentinel\Mailers\UserMailer@welcome', 10);
$events->listen('user.resend',      'Sentinel\Mailers\UserMailer@welcome', 10);
$events->listen('user.forgot',      'Sentinel\Mailers\UserMailer@forgotPassword', 10);
$events->listen('user.newpassword', 'Sentinel\Mailers\UserMailer@newPassword', 10);

User Login Event Listener

Event::listen('sentinel.user.login', function($user)
{
    Session::put('userId', $user->id);
    Session::put('email', $user->email);
}, 10);

User logout Event Listener

Event::listen('sentinel.user.logout', function()
{
    Session::flush();
}, 10);
Clone this wiki locally
0