All about Redirects in Laravel 5
Laravel has a useful function redirect() to, well, redirect a user to a different page or action, with or without data. Let’s discuss those various options in one place – maybe you will find out something new for yourself.
Notice: if you use Laravel 4, note that those functions changed and were simplified in Laravel 5 – for example, instead of Redirect::to() in new version we use just redirect().
For all the examples I will use a case of a Controller method, where the main action has been done, and now at the end it’s time to redirect a user somewhere. So typically, the code snippets below represent the last row of Controller method.
This post is submitted by one of our members. You may submit a new post here.