For some reason I can't get any GET parameters from a url in my controllers using the Illuminate\Http\Request
facade. I tested in multiple controllers, but no success.
Using the following code, nothing is returned on the remote server when accessing domain.com/admin/dashboard?test=test
, but on my local machine it returns test
:
The dashboard function is called by the route /admin/dashboard
/**
* Dashboard page
*
* @return view
*/
public function dashboard(Request $request)
{
echo '<pre>';
var_dump($request->all());
echo '</pre>';
// Return here
return;
// ...instead of here
return view('backend::pages.dashboard');
}
I'm running Laravel 5.1 on Ubuntu 14.04 LTS using Nginx and php5-fpm. The code works fine on my local Homestead instance as well as on MAMP. I checked my Nginx configuration and everything seems fine. I'm hosting multiple sites on my server and I can get route parameters on all other sites.