Laravel doesn't use the query part of a uri
for routing, for localhost/admin/users?data=refresh
you may use something like this:
Route::get('admin/users', function(){
$data = Input::get('data');
});
You can make a request to the route using localhost/admin/users?data=refresh
. You can declare your route
like this:
Route::get('admin/users' , array('before' => 'ajax:data', 'as' => 'admin.users', 'uses' => 'Admin\Users\UsersController@dataRefresh'));
Here, refresh
is passed to route filter and is available in third argument ($param
) so you can retrieve refresh
in $param
. Create the filter as given below:
Route::filter('ajax', function($route, $request, $param){
// This will give query string 'refresh'
// if you passed it as http://domain.com?data=refresh
$data = $request->get($param);
// You can retrieve the $param, third argument
// if you pass a parameter, i.e. 'refresh'
// param will contain 'refresh'
});