Laravel 5.2 directory structure

Laravel 5 have completely different directory structure than laravel 4, so if you want to switch your application to laravel 5, you can start by learning the directory structure first. In this article i will show directory structure in laravel 5.2, but it should be compatible with other version of laravel 5.

This folder is where you define your own artisan command, in laravel 4 it used to be app/commands. Inside app/Console there is another folder called Commands.

This is where your event classes lives.

The app/Exceptions directory contains your application's exception handler and is also a good place to stick any exceptions thrown by your application.

This is where you put your controller classes.

This is your route file.

The app/Jobs directory, of course, houses the queueable jobs for your application. Jobs may be queued by your application or run synchronously within the current request lifecycle.

The app/Listeners directory contains the handler classes for your events. Handlers receive an event and perform logic in response to the event being fired. For example, a UserRegistered event might be handled by a SendWelcomeEmail listener.

The app/Policies directory contains the authorization policy classes for your application. Policies are used to determine if a user can perform a given action against a resource.

The bootstrap directory contains a few files that bootstrap the framework and configure autoloading, as well as a cache directory that contains a few framework generated files for bootstrap performance optimization.

The config directory, as the name implies, contains all of your application's configuration files.

this folder is where your migrations, seeds and factory lives, it used to be in app/database in laravel 4.

The public directory contains the front controller and your assets (images, JavaScript, CSS, etc.).

The resources directory contains your views, raw assets (LESS, SASS, CoffeeScript), and localization files.

The storage directory contains compiled Blade templates, file based sessions, file caches, and other files generated by the framework. This directory is segregated into app, framework, and logs directories. The app directory may be used to store any files utilized by your application. The framework directory is used to store framework generated files and caches. Finally, the logs directory contains your application's log files.

The tests directory contains your automated tests. An example PHPUnit is provided out of the box.

The vendor directory contains your Composer dependencies.

No comments :

Post a Comment

Leave A Comment...