public static function setUserInfo($user)
    {
        if (!empty($user)) {
            \Session::put('user.id', array_get($user, 'id'));
            \Session::put('user.name', array_get($user, 'name'));
            \Session::put('user.username', array_get($user, 'username'));
            \Session::put('user.display_name', array_get($user, 'name'));
            \Session::put('user.first_name', array_get($user, 'first_name'));
            \Session::put('user.last_name', array_get($user, 'last_name'));
            \Session::put('user.email', array_get($user, 'email'));
            \Session::put('user.is_sys_admin', array_get($user, 'is_sys_admin'));
            \Session::put('user.last_login_date', array_get($user, 'last_login_date'));
            \Session::put('user.ldap_username', array_get($user, 'ldap_username'));

            return true;
        }

        return false;
    }
public static function setUserInfo($user)
    {
        if (!empty($user)) {
            \Session::put('user.id', array_get($user, 'id'));
            \Session::put('user.name', array_get($user, 'name'));
            \Session::put('user.username', array_get($user, 'username'));
            \Session::put('user.display_name', array_get($user, 'name'));
            \Session::put('user.first_name', array_get($user, 'first_name'));
            \Session::put('user.last_name', array_get($user, 'last_name'));
            \Session::put('user.email', array_get($user, 'email'));
            \Session::put('user.is_sys_admin', array_get($user, 'is_sys_admin'));
            \Session::put('user.last_login_date', array_get($user, 'last_login_date'));
            \Session::put('user.ldap_username', array_get($user, 'ldap_username'));

            return true;
        }

        return false;
    }
public static function setUserInfo ( $ user ) { if ( ! empty ( $ user ) ) { \ Session :: put ( 'user.id' , array_get ( $ user , 'id' ) ) ; \ Session :: put ( 'user.name' , array_get ( $ user , 'name' ) ) ; \ Session :: put ( 'user.username' , array_get ( $ user , 'username' ) ) ; \ Session :: put ( 'user.display_name' , array_get ( $ user , 'name' ) ) ; \ Session :: put ( 'user.first_name' , array_get ( $ user , 'first_name' ) ) ; \ Session :: put ( 'user.last_name' , array_get ( $ user , 'last_name' ) ) ; \ Session :: put ( 'user.email' , array_get ( $ user , 'email' ) ) ; \ Session :: put ( 'user.is_sys_admin' , array_get ( $ user , 'is_sys_admin' ) ) ; \ Session :: put ( 'user.last_login_date' , array_get ( $ user , 'last_login_date' ) ) ; \ Session :: put ( 'user.ldap_username' , array_get ( $ user , 'ldap_username' ) ) ; return true ; } return false ; }
Sets basic info of the user in session when authenticated.

@param array $user

@return bool
Sets basic info of the user in session when authenticated .