How to Get Query Strings Value in Laravel?
In this post we will give you information about How to Get Query Strings Value in Laravel?. Hear we will give you detail about How to Get Query Strings Value in Laravel?And how to use it also give you demo for it if it is necessary.
If you want to get Query string value then you can get using Request Facade OR Input Facade in larave 5. But if you was working native PHP then we can get $_GET method. In following example you can easily get parameter value.
URL Example:
http://text.com/wall?id=23&name=hdtopi
In above query string, you want to get query string value for example id and name. you can get through bellow example.
Route Example:
Route::get('wall', 'WallController@wall');
Controller Example:
public function wall(Request $request)
{
/* returns Ony Id value */
$id = $request->input('id');
/* returns array of entire input query value */
$query = $request->all();
/* OR */
/* returns Ony Id value */
$id = Input::get('id');
/* returns array of entire input query value */
$query = Input::all();
}
Hope this code and post will helped you for implement How to Get Query Strings Value in Laravel?. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs