Laravel 5.7 Resources Directory Changes

Laravel 5.7 Resources Directory Changes

Taylor Otwell announced that in Laravel 5.7 the resources directory will be flattened instead of having an assets folder:

Laravel 5.6’s resources directory looks like this:

resources
├── assets
│   ├── js
│   └── sass
├── lang
│   └── en
└── views

And the upcoming resources directory will look like the following in Laravel 5.7:

resources
├── js
├── lang
├── sass
└── views

You could even make a move now in your Laravel 5.6 assets ahead of this change. First, you need to update your Laravel Mix configuration:

let mix = require('laravel-mix');

mix.js('resources/js/app.js', 'public/js')
   .sass('resources/sass/app.scss', 'public/css');

Then you can move the directories and clean up with the following:

mv resources/assets/* resources
rm -Rf resources/assets/

I like the change to flatten things, and I feel like it cleans up the editor sidebar and has less mental overhead for navigating.


Filed in: Laravel 5.7


Newsletter

Join the weekly newsletter and never miss out on new tips, tutorials, and more.

Laravel News Partners

Laravel Jobs

Senior PHP Developer (Full Stack | CakePHP | Laravel | Vue | jQuery)
Remote
continued
Senior Laravel Developer (Full-Stack)
Munich
Volunteer Vision GmbH
Full-Stack Developer
Tampa
Nu Image Medical
Senior Software Developer
Remote (US ONLY)/Kenilworth, NJ
Diversified
Senior Back-end Laravel API Developer - Immediate Contract (Full Time)
Remote
ApproveMe // Document Signing
Web Development Project Manager
Houston, TX
Swyft Filings
Experienced Laravel/VueJS Developer (Freelance)
Remote (preferably in the US)
Prosperly LLC