How to Get Request Data in Laravel 5.2
This post explain how to get request data in routes.php file and in Laravel 5.2 controllers. The request data includes the parameters submitted via URL query string e.g. /search?category=furniture, here category is parameter name and furniture is parameter value. If a form is submitted via GET or POST, the data that is sent to server is also called request data. In short, request data is data that a request carries. When Laravel framework receive an HTTP request, before transferring request processing to controllers, the framework extract data from request and instantiate an object of type Request , which is Laravel provided class. The Request object contain all the data that HTTP request carries. The Laravel framework passes the object using dependency injection into controller methods. It is passed only if we have expressed our interest by declaring an argument of type Request in controller methods. After receiving the Request object as argument, we can read the parameter ...