You don't have to use back(). Login process works this way:
1) A 'still not logged' user try to browse your site and hit a route:
Route::get('dashboard', 'DashboardController@dashboard');
2) But is redirected to the login form:
return Redirect::to('?openOverlay=login');
3) After a successful login you have to use Redirect::intended()
to redirect your user to the url he/she first tried to access:
if (Auth::attempt(array('email' => $email, 'password' => $password)))
{
// Login succeeded, redirect it to the intended url
return Redirect::intended('home');
}
else
{
/// Login failed, redirect back to login, so your user can try to login again
return Redirect::back()->with('error-login-noconfirm','1');
}
Your user will be redirected to 'dashboard' and the 'home' is a fallback route, just in case something happened to the session and there is no more intended ('dashboard') url on it.
If the intended url is not the first one accessed, you can change it in Session:
$path = Session::put('url.intended', $the_actual_url_intended);