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.

app/Console
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.

app/Events
This is where your event classes lives.

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

app/Http/Controllers
This is where you put your controller classes.

app/Http/routes.php
This is your route file.

app/Jobs
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.

app/Listeners
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.

app/Policies
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.

bootstrap
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.

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

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

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

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

storage
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.

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

vendor
The vendor directory contains your Composer dependencies.




EmoticonEmoticon