Skip to content

Commit

Permalink
[5.2] Added "hasHeader" request method (#13271)
Browse files Browse the repository at this point in the history
* Determine if header is set on request

* CS fix

* More CS
  • Loading branch information
mlantz authored and taylorotwell committed Apr 23, 2016
1 parent 4219f0a commit c04159d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Illuminate/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,17 @@ protected function isValidFile($file)
return $file instanceof SplFileInfo && $file->getPath() != '';
}

/**
* Determine if a header is set on the request.
*
* @param string $key
* @return bool
*/
public function hasHeader($key)
{
return ! is_null($this->header($key));
}

/**
* Retrieve a header from the request.
*
Expand Down

0 comments on commit c04159d

Please sign in to comment.