Application Structure of Laravel 5 Framework

2022-08-08 16:21:45 Jamir Laravel

Laravel Directory Structure

Laravel provides clean and easy to understand configurable application directory Structure. After installing Laravel successfully in root folder you will find below directories or files that are used to create small to large scale PHP Projects using Laravel Framework.

Laravel's App Directory

App Folder is one of major folder/directory in Laravel Framework, In Laravel Most of logics are written in App folder. This folder/directory contains the following folders.

  • Console
  • Exceptions
  • Http
  • Controllers
  • Middleware
  • Providers

Laravel's Bootstrap Directory

The bootstrap directory of Laravel contains files are used for bootstrapping and configuring Laravel Framework itself. This directory also contains a cache directory which holds all framework generated files for performance optimization and

  • bootstrap
  • cache

Laravel's Config Directory

This directory contains all configuration related files of Laravel Framework. In this directory consist of below files

  • app.php
  • auth.php
  • broadcasting.php
  • cache.php
  • database.php
  • filesystems.php
  • mail.php
  • queue.php
  • services.php
  • session.php
  • view.php

Laravel's Database Directory

Laravel's Database Directory is used to keep your database migrations and seeds. If you are going to use SQLite Database, then you can also use this directory to hold an SQLite DB.

Laravel's Public Directory

The public directory of Laravel consists of a file named index.php.In Laravel this file is an entry point for your application. This directory also holds your public assets like images, js, CSS files.

Laravel's Resources Directory

Laravel's Resources directory contains all view files oof your application. This directory also holds your language files

Laravel's Routes Directory

The routes directory of Laravel contains all of the routes of your applications. web.php, api.php, console.php, and channels.php are default routes files that are included in Laravel 5.5

  • web.php:-This file contains all routes that RouteServiceProvider places in web middleware group which provides session state, CSRF protection, and cookie encryption.
  • api.php:-This file contains all routes that RouteServiceProvider places in the API middleware group, which provides rate limiting.
  • console.php:-In this file you may define all of your Closure based console commands.
  • channels.php:- In the file, you may register all of the event broadcasting channels that your application supports

Laravel's Storage Directory

The storage directory of Laravel contains all of your compiled blade files, sessions files, file caches, and other files generated by the framework.

The storage/app/public is available for storing user-generated files, such as profile image, product images, etc

Laravel's Tests Directory

The tests directory contains all of your automated tests

Laravel's Vendor Directory

The vendor directory contains Composer dependencies related files of your application.

Thank You!!

This post is submitted by one of our members. You may submit a new post here.

Related Tricks