Learn laravel directory structure

Hello World,Today i am going to create article in which we will learn laravel directory structure. In this article, we will learn about all folders and files at the root path of laravel.

Following is the directory structure screenshot of laravel.


Lets walk through one by one to get familiar. The root directory contains the following folder by default.


In this folder your actual application will work. All the controllers, modes, commands and your php domain code all go in here.


This folder contains the files that the laravel framework use to boot every time it runs.


This folder contains the all configuration files


In this folder, All the database, migrations, seeds and factories are live.


The directory the server points to when its serving the website. The index.php, which is the front controller that kicks off the bootstrapping process and routes all request appropriately. Its also where any public-facing files like images, stylesheets, scripts, or downloads go.


Where files that are needed for other scripts live. Views, langauge files, and Sass/Less/Source CSS and source Javascript files.


Here all the routes definition are live, both  for HTTP routes and Console routes or artisan commands.


Where Caches, logs and compiled system files live.


Where unit and integration tests live.


Where composer installs its decencies. Its git-ignored, as composer is expected to run as a part of your deploy process on any remote servers.

Following are some loose files which has been defined as follow:


Gives your IDE/Text editor instructions about laravel’s coding standards like the size of indents, the charset, and whether to trim trailing whitespace. You will see this in any laravel apps running greater than or equal to version 5.5.

.env and .env.example

Dictate the enviroment variables. .env.example is a template that each enviroment should duplicate to create its own .env file, which is GIT-ignored

.gitignore and .gitattributes

These files contains git configuration.


Allow you to run artisan commands from the command line.

composer.json and composer.lock

Configuration files for composer, This file is editable. composer.lock is not editable. These files share some basic information about the project and also define its php dependencies.


package.json like composer.json but for frontend assets and dependencies of the build system; it instruct NPM to install defined packages.


This file is use to perform PHPUnit.


This markdown file gives the basic introduction of laravel.


A backup server that tries to allow less-capable servers to still preview the laravel application.


The configuration file for mix. These files are giving you build system directions on how to compile and process your frontend assets.

I hope you are enjoying my tutorials. Please add your feedback in the comment section. Thank you. 🙂 🙂

Leave a Reply

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