djekl
1/4/2014 - 10:58 AM

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.

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()));
        }
    }
});