Aug 8, 2016 | laravel, laravel 5.3

Directory structure changes in Laravel 5.3

Series

This is a series of posts on New Features in Laravel 5.3.

!
Warning: This post is over a year old. I don't always update old posts with new information, so some of this information may be out of date.

We've already covered the new routes directory and the changes that will make to the directory structure. But there's one other directory change coming in Laravel 5.3: many of the default folders will not show up until you run a command that requires them.

These directories come in each new version of Laravel prior to 5.3 but are often not used, so all new installs won't have them. Here's the list of folders that are going away:

  • Events
  • Jobs
  • Listeners
  • Policies

Notice a pattern? These are directories that contain a single, more advanced class structure that aren't universal to Laravel apps. Events, Jobs, Listeners, and Policies.

One note: If you were used to manually creating classes for each of those structures, you may find this change adds an extra step; but if so, it's really worth considering using Artisan to create them anyway. Artisan will handle creating these directories if they don't exist, so the change should be transparent in that context.

For a great visual of how this change will simplify a default Laravel install, take a look at this graphic from Laravel News:

Laravel App Folder Changes

(image from Laravel News post Laravel 5.3 changes the 'app' folder)

There are also new folders that won't show up on a new install but might show up after you use Artisan generators: app/Mail for Mailables and app/Notifications for Notifications.


Comments? I'm @stauffermatt on Twitter


Tags: laravel  •  laravel 5.3


This is part of a series of posts on New Features in Laravel 5.3:

  1. Jun 16, 2016 | laravel, laravel 5.3, echo, websockets
  2. Jun 27, 2016 | laravel, laravel 5.3
  3. Jun 29, 2016 | laravel, laravel 5.3, eloquent
  4. Jul 6, 2016 | laravel, laravel 5.3
  5. Jul 8, 2016 | laravel, laravel 5.3, eloquent
  6. Jul 25, 2016 | laravel, laravel 5.3
  7. Jul 26, 2016 | laravel, laravel 5.3
  8. Jul 27, 2016 | laravel, laravel 5.3, routing
  9. Jul 27, 2016 | laravel, laravel 5.3, laravel scout, laravel passport, mailable
  10. Jul 29, 2016 | laravel, laravel 5.3, laravel scout
  11. Jul 30, 2016 | laravel, laravel 5.3, laravel passport, oauth
  12. Aug 5, 2016 | laravel, laravel 5.3, mail, laravel mailables
  13. Aug 8, 2016 | laravel, laravel 5.3
  14. Oct 19, 2016 | laravel, laravel 5.3, laravel notifications, notifications
  15. Dec 21, 2016 | laravel, laravel 5.3, vuejs, vueify, authorization
  16. Dec 21, 2016 | laravel, laravel 5.3, queues
  17. Jan 30, 2017 | laravel, laravel 5.3, artisan

Subscribe

For quick links to fresh content, and for more thoughts that don't make it to the blog.