laravel/framework — pull request #4809 by zupolgec (2014-06-23 16:07:10+00:00)
Title: Fix handling of internal requests

When I want to call a route from another route, I do:
```
Route::get('test', function() {
$request = Request::create('/api-uri', 'GET', ['param1' => 'value1']);

return Route::dispatch($request)->getContent();
});
```

In doing this, a new Request is created (with Symfony as UserAgent) but if I use the Input facade in my controller, the Request accessed by the `get` method is the main request, the one pointing to the `/test`URI.
So I think that the `dispatch` function on the Router should store the main Request, change the request on the app container to the new one, call the Controller method, and then put back the original request.