PHP LARAVEL Directory Structure

When you create a fresh laravel project, you will be provided with the following files and directory to start with.
Let's walks through the directories one by one.
 

Directory

Description

app

The app directory contains the core code of your application. Models, controllers, routes all goes in here.    

bootstrap

The bootstrap directory contains all the bootstrapping scripts (app.php) used for your application. This directory also houses a cache directory which contains framework generated files for performance optimization such as route and service cache files.

config

The config directory holds all your project configuration files (.config).

database

The database directory holds your database migrations, models and seeds.

public

The public directory helps in starting your Laravel project and also holds other scripts (JavaScript and CSS) as well, along with images required for your project.

resources

The resources directory holds all the Sass files, language (localization) files, templates (if any).

routes

The routes directory is where all of the route definitions live, both for HTTP routes, Console.

storage

The storage directory holds your session files, cache, compiled blade templates as well as miscellaneous files generated by the framework.

test

The test directory holds all your test cases.

vendor

The vendor directory holds all composer dependency files. It is Git ignored

 Now let's walk overs the files in the root folder.

Files

Description

.env   .env.example

It's an environment related files, this files should not be committed to your application source's control, since each person using the application will require a different environment. Any variable in your .env file can be overriden by external environment variables such as server-level or system-level.

.gitattributes .gitignore

Git configuration files, .gitignore holds the list of files/directory to be excluded from the source control.

artisan

The file that allows you to run the artisan command in the console.

composer.json composer.lock

Configuration files for composer, composer.json is where you define you dependencies and it is user editable, and updated automatically, if you run any composer require depencies command separately. The composer.lock holds the complete record of every dependency and all of the sub dependencies installed with each dependcy, which is installed by composer.json, this files is not 

package.json

As composer.json, package.json is used for maintaining the metadata details for the frontend assests.

phpunit.xml

Configuration file for phpunit test.

readme.md

Basic introduction file for Laravel

server.php

Backup server which provides a convenient way to test Laravel application with having a installed real web server.


Happy Programming...!!!

Comments

Popular posts from this blog

Method Reference in Java Streams

PHP LARAVEL - Hello World Laravel