New Route Methods introduced in Laravel 5.5

New Route Methods introduced in Laravel 5.5

Laravel 5.5 shipped a couple of convenient shortcuts to the Laravel Router class that eliminates the need for creating a controller or closure only to return a simple view or redirect. If you missed them in the release notes, let’s look at them briefly, they are sure to simplify your code and remove a couple of files.

  • The Route::view method

The Route::view method eliminates the need for routes that only need a view returned. Instead of using a controller or a closure, you can define a URI and a path to a view file:

Originally published at mobiosolutions.com on November 7, 2017.

Leave a Reply

Your email address will not be published. Required fields are marked *