-
Notifications
You must be signed in to change notification settings - Fork 11.3k
[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
base: 12.x
Are you sure you want to change the base?
Conversation
Refactored the get method to replace the parent class method call with data_get, which retrieves the query payload item from the request using the input source. This improves flexibility in handling the request data.
Tests are failing |
The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using ' public function get(string $key, mixed $default = null): mixed
{
return data_get($this->getInputSource()->all(), $key, $default);
} You could make call directly wirh the database, however proper security needs to be configurated as DB table name would be exposed in the code
@Charlesnorris509 This PR has nothing do with DB calls. The request input could be used anywhere. |
Thank you. You letting me know i'll re-read the code to improve my understanding |
Why use get over input? You can pass dot notation as the first parameter to input. |
@marandy0905 You are right. input is for laravel, get for symfony. We use get as it is now and we have no issues with it. If someone wants dot notation, they should use input method. |
Refactored the get method to replace the parent class method call with data_get, which retrieves the query payload item from the request using the input source. This improves flexibility in handling the request data.
Wanted something like:
Found that get method does not support dot syntax to access data.
Changes: