Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions src/Illuminate/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ class Request extends SymfonyRequest implements ArrayAccess {
*/
protected $routeResolver;

/**
* The array containing all inputs of the request.
* @var array
*/
protected $input;

/**
* The array containing all inputs and files of the request.
* @var array
*/
protected $all;

/**
* Create a new Illuminate HTTP request from server variables.
*
Expand Down Expand Up @@ -274,7 +286,12 @@ protected function isEmptyString($key)
*/
public function all()
{
return array_replace_recursive($this->input(), $this->files->all());
if ($this->all === null)
{
$this->all = array_replace_recursive($this->input(), $this->files->all());
}

return $this->all;
}

/**
Expand All @@ -286,9 +303,12 @@ public function all()
*/
public function input($key = null, $default = null)
{
$input = $this->getInputSource()->all() + $this->query->all();
if ($this->input === null)
{
$this->input = $this->getInputSource()->all() + $this->query->all();
}

return array_get($input, $key, $default);
return array_get($this->input, $key, $default);
}

/**
Expand Down