Skip to content

Instantly share code, notes, and snippets.

@djekl
Last active January 2, 2016 04:59
Show Gist options
  • Save djekl/8254209 to your computer and use it in GitHub Desktop.
Save djekl/8254209 to your computer and use it in GitHub Desktop.
This is what I fire before every request to check if the user is logged in, and if not then attempt via remember cookie, then fire the auth.login event if logged in.
<?php
App::before(function($request)
{
if (!Auth::check())
{
Auth::viaRemember();
if (Auth::check())
{
Event::fire('auth.login', array(Auth::user()));
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment