5.2.30 Laravel Code Update - Important Change

preview_player
Показать описание
If you are working with Laravel, there is a recent change at or around 5.2.30 where routes no longer need the web middleware to be explicitly defined. In the past we had to make a route group for our web middleware but now with the newest version of Laravel, that is no longer necessary as all routes have the web middleware applied by default.

You can test this by running:
php artisan route:list

The table that comes up has a column on the far right that shows all the middleware applied to your application. Newer Laravel applications will notice that you had web middleware applied even if you dont have it in a route group. This is a big change and if you are unaware of it, you might add it like we used to have to and it can cause lots of problems with your application.

To see the current version of Laravel that you are using, you can simply type:
php artisan --version

Type this command in your project file to get the current version.

--- HOW TO STAY UP TO DATE ON LARAVEL ---

Subscribe to this Channel!

Subscribe to Laravel Subreddit

Watch on GitHub:

--- FOLLOW ME ---

The best way to reach out to me is Twitter:

You can also email:

-----

Tags: Laravel error code update. Routes not working 5.2.31 or 5.2.30. Laravel 5.2 problem. Help fix. Tutorial. How to. Web middleware.
Комментарии
Автор

Hello Alex. So kind of you to bring this issue to our attention. It's so comforting to know that you are always looking out for our best interests. Have a wonderful day. Peter

Osteele
Автор

I am watching your laravel series from beginning. . it's really awesome. It would be great if you can Please make a Facebook group. where we can ask questions and discuss about problems.
thanks

souravroy
Автор

thanks for the video...i was screwed with this problem in showing error or info message in my testing app. the problem was solved after removing that route which i put manually :P

wasidhossain
Автор

Hi Alex, You are really a great developer & teacher.. I wish you can create a series about authorization in laravel.. Thank you for your videos.. Greetings from Indonesia! :D

henergy
Автор

This is my old routes code.

Route::group(['middleware' => ['web']], function () {
});

after the update, am guessing it should be like


without the middlware explicity defined and the group

joshnoni
Автор

Hi, i was going through the laravel updates on git hub. does this mean i should change every line of code they added to the respective files and delete the ones they removed. kinda confused. cause am on 5.2.31 but the files still have the old code.

joshnoni
Автор

what about the sql pro connection error ?

peterm.souzajr.
Автор

hey Alex,
my laravel version is 5.2.30 and the notification with session you taught doesn't works on mine could it be because of the last update?

janakshrestha
Автор

how do i update once i see a new laravel version is available?

peterm.souzajr.