Laravel Structure | Laravel - Application Structure
What is Application Structure in Laravel?
- The default Laravel application structure is intended to provide a great starting point for both large and small applications.
- Of course, you are free to organize your application however you like.
- Laravel imposes almost no restrictions on where any given class is located - as long as Composer can autoload the class.
- Laravel is referred to as a full stack background because it handles everything from web serving to database management right down to HTML generation.
Root Directory
- The root directory of Laravel contains various folders and files as shown in the following figure.
app
- This manual contains the main code of the application.
laravel , laravel framework , laravel documentation , laravel tutorial , laravel install , laracasts
bootstrap
- This directory holds the application bootstrapping script.
laravel , laravel framework , laravel documentation , laravel tutorial , laravel install , laracasts
config
- This directory contains configuration files of application.
database
- This folder contains your database relocation and seeds.
public
- This is the application’s document root. It starts the Laravel application. It also contains the assets of the application like JavaScript, CSS, Images, etc.
resources
- This directory contains raw assets such as the LESS & Sass files, localization and language files, and Templates that are rendered as HTML.
laravel , laravel framework , laravel documentation , laravel tutorial , laravel install , laracasts
storage
- This directory contains App storage, like file uploads etc. Framework storage (cache), and application-generated logs.
test
- This directory contains various test cases.
laravel , laravel framework , laravel documentation , laravel tutorial , laravel install , laracasts
vendor
- This directory contains composer dependencies.
App Directory
- This is the application directory. It contains a variety of additional directories, which are described below −
Console
- All the artisan commands are stored in this directory.
Events
- This directory stores events that your application can raise. Events may be used to alert other parts of your application that a given action has occurred, providing a great deal of flexibility and decoupling.
Exceptions
- This directory contains your application's exception handler and is also a good place to stick any exceptions thrown by your application.
Http
- This directory contains your controllers, filters, and requests.
laravel , laravel framework , laravel documentation , laravel tutorial , laravel install , laracasts
Jobs
- This directory contains the queueable jobs for your application.
Listeners
- This 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 User Registered event might be handled by a Send Welcome Email listener.
laravel , laravel framework , laravel documentation , laravel tutorial , laravel install , laracasts
Policies
- This directory contains various policies of the application
Providers
- This directory contains various service providers.