I want to make an instant redirection in my controller in Laravel.
I know I can use
public function show($page)
{
return Redirect::url(\'http://ex
After a while of digging it seems that for this purposes you should use send() method from Symfony\Component\HttpFoundation (Laravel RedirectResponse inherits from this class).
So you can modify checkPages method this way:
public function checkPages($page, $totalPages, $url)
{
if ($page < 2 or $page > $totalPages) {
Redirect::url($url)->send();
}
}
and it will make instant redirection.