public function user($guard = null)
    {
        $user = Auth::guard($guard)->user();

        return $user ? [
            'className' => get_class($user),
            'id'        => $user->getAuthIdentifier(),
        ] : [];
    }
public function user($guard = null)
    {
        $user = Auth::guard($guard)->user();

        return $user ? [
            'className' => get_class($user),
            'id'        => $user->getAuthIdentifier(),
        ] : [];
    }
public function user ( $ guard = null ) { $ user = Auth :: guard ( $ guard ) -> user ( ) ; return $ user ? [ 'className' => get_class ( $ user ) , 'id' => $ user -> getAuthIdentifier ( ) , ] : [ ] ; }
Retrieve the authenticated user identifier and class name.

@param  string|null  $guard

@return array
Retrieve the authenticated user identifier and class name .