I am having an issue trying to make a GET request to a route and process the parameters passed in via the URL. Here are two routes I created in routes.php
:
$router->get('/', function() {
$test = \Input::get('id');
dd($test);
});
$router->get('test', function() {
$test = \Input::get('id');
dd($test);
});
When I go to the first URL/route ('/') and pass in some data, 123 prints to the screen:
http://domain.com/dev/?id=123
When I go to the second ('test') NULL prints to the screen (I've tried '/test' in the routes.php
file as well).
http://domain.com/dev/test?id=123
A few things to note here:
- This installation of Laravel is in a subfolder.
- We are using Laravel 5.
Any idea why one would work and the other would not?