Request::user PHP Méthode

user() public static méthode

Get the user making the request.
public static user ( string | null $guard = null ) : mixed
$guard string | null
Résultat mixed
        public static function user($guard = null)
        {
            return \Illuminate\Http\Request::user($guard);
        }

Usage Example

 public function getTickets()
 {
     if (\Request::ajax()) {
         $tickets = \Request::user()->tickets()->with('event')->orderBy('created_at', 'desc')->paginate(15);
         return \Response::json($tickets);
     }
     return \Response::json(['status' => 'error'], 400);
 }
All Usage Examples Of Request::user