What’s new in Laravel 5

Laravel’s upcoming version will be 5.0, there will no longer be a 4.3 release. The primary reason for this change is a change in directory structure. Here is a summary of new features and major changes.

New directory structure

Laravel 5 new directory structure, compared to Laravel 4

Laravel 5’s new directory structure, compared to Laravel 4

The app directory has been trimmed to only contain code that would be in the namespace of the application you are working with. Files that are not code such as cache and log data have their own directories. Views, database migrations, tests and all other code that is not application logic is also separated.

The idea, simplified, is to put anything that would be in a class within the “app” directory.

The reason behind all this is to encourage having everything to do with your application logic to be contained in one directory. Furthermore, it suggests having application logic in a namespace named after your application. This is in line with best practices, namely it allows for PSR-4 autoloading. By default, the name given for the namespace is “App”. If you want this changed to “Quux” for instance, you can use this artisan command:

php artisan app:name Quux

New helper functions

At least 9 new helper functions have been added for commonly invoked routing, logging, and other methods.

See a full list: New helper functions in Laravel 5

Other changes

Share and Enjoy

  • Facebook
  • Twitter
  • Google Plus
  • LinkedIn
  • Reddit
  • Pinterest

Leave a Reply

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