Skip to content

[12.x] Refactor get method to use data_get for query payload retrieval #55003

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: 12.x
Choose a base branch
from
Draft
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
8 changes: 3 additions & 5 deletions src/Illuminate/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -398,18 +398,16 @@ public function replace(array $input)
}

/**
* This method belongs to Symfony HttpFoundation and is not usually needed when using Laravel.
* Retrieve a query payload item from the request.
*
* Instead, you may use the "input" method.
*
* @param string $key
* @param string|null $key
* @param mixed $default
* @return mixed
*/
#[\Override]
public function get(string $key, mixed $default = null): mixed
{
return parent::get($key, $default);
return data_get($this->getInputSource()->all(), $key, $default);
}

/**
Expand Down
Loading