Request::header PHP Method

header() public static method

Retrieve a header from the request.
public static header ( string $key = null, string | array | null $default = null ) : string | array
$key string
$default string | array | null
return string | array
        public static function header($key = null, $default = null)
        {
            return \Illuminate\Http\Request::header($key, $default);
        }

Usage Example

Example #1
0
 /**
  * Retrieve the authenticated User.
  *
  * @param  Request  $request
  * @return App\Models\User|bool
  */
 public function getUser($request)
 {
     $uid = $request->header('ID');
     $token = $request->header('X-Auth-Token');
     $user = Sentinel::findById($uid);
     if ($user->api_token == $token) {
         return $user;
     }
     return false;
 }
All Usage Examples Of Request::header