As I'm studying the book Code Bright , I get errors from time to time. But this one did not find a solution in Google.
When doing Redirect::to()
from one route to another should be displayed the previous full address, but only appears the URL of my vhost
without the rest of the route.
Code of the book Code Bright:
Route::get('first', function()
{
// redirect to the second route
return Redirect::to('second');
});
Route::get('second', function()
{
return URL::previous();
});
When I enter endereço/first
and I'm redirected to the endereço/second
route, it should be written endereço/first
but only address appears.
Question
What would be the correct solution to resolve the impression of the return url?
Detail, I checked in github that I understand the Redirect::to
generates a call 302 that does not transmit the information from where the route request is coming from. Maybe I'm wrong about this.