Could you please tell me how to verify the parameters passed by get in laravel
There are many filtering conditions at the top of the order list page, but these filtering conditions have certain rules. For example, the amount must be a number, and the user name cannot be greater than 5 digits.
If parameters are passed to the background through get for conditional filtering, the url address and How to verify that it is the same when no parameters are passed?
If verification is performed, if the user comes in without any filtering conditions at the beginning, the verification will fail directly
One solution is to add an area to display errors on the page and display it using the method provided by Laravel (submit the form directly, use js to verify whether the information is legal before submitting, submit after the js verification passes, and then verify it on the backend)
However, this method is not very friendly. You can change the screening form submission to asynchronous, and use js to render the page results.
Parameter filtering rules?
Use middleware decisively, get the get parameter request, $request->getQueryString(), and then put it in the middleware for screening.
Don’t verify the format if there are no parameters passed in.
Verify only after passing the parameters.