Search code examples
laravellaravel-5laravel-5.3laravel-routinglaravel-5.4

How to get new laravel 5.4 folder structure


I updated my laravel app from 5.2 to 5.3 then 5.4 (To avoid problems with direct update). The update was successful and my app is working fine. But then I can't find changes in the folder structure. A particular change I will like to see is my routes.php file leaving from root/app/Http/ to root/routes/.

I am wondering if this is normal and how I can modify it to take the new structure thanks in advance!


Solution

  • Well, if you update your app, those changes won't be made automatically. In upgrade guide there are only described changes that are necessary to make your application work.

    When we are talking about routes, it's not so important, so you can have them as you had before or if you want you can move them and also rename those files (now there is no routes.php file but web.php, api.php and console.php files).

    To move routes into new structure you should compare https://github.com/laravel/laravel/blob/5.2/app/Providers/RouteServiceProvider.php with https://github.com/laravel/laravel/blob/master/app/Providers/RouteServiceProvider.php - so you need to update your RouteServiceProvider file and move files into new locations.