With Laravel 5, I cannot configure route parameters.
My route is configured as follows:
Route::get('test', ' TestController@test ');
And my TestController looks like this:
public function test(Request $request) { var_dump($request->input('foo')); }
When I view this route with the parameter
/test?foo=bar
the result is NULL.
Can anyone tell me what I'm doing wrong?
The syntax of Input :: get ('foo') does not work (and is not even mentioned in the documentation for L5).
Update:
I use Apache as a web server.
I also tried
$request->get('foo')
and a route like this
Route::get('test/{foo?}', ' TestController@test ');
with the same url and still gets null.
Update 2:
The L5 documentation provides examples of such routes:
/test/bar
instead
/test?foo=bar
In L4, you could find routes using GET, for example
/test?foo=bar&id=2&user=admin
or reordering
/test?id=2&user=admin&foo=bar
with the same route
Route::get('test', ' TestController@test ');
and all you had to do was get it using
Input::get('user')
But with L5 it would be impossible to change the order of parameters when you need to use slashes in routes, for example
Route::get('test/{id}/{user}/{foo}', ' TestController@test ');
Is this really a big drop for routes in L5?