Course Content
Laravel Introduction
Laravel is a PHP framework that uses the MVC architecture. Laravel is a robust framework that provides easy development of PHP web applications with features like a modular packaging system with a dedicated dependency manager, access to relational databases, and other utilities for application deployment and maintenance.
0/4
Laravel Routing
Routing is one of the essential concepts in Laravel. Routing in Laravel allows you to route all your application requests to its appropriate controller. The main functionality of the routes is to route all your application requests to the appropriate controller.
0/3
Laravel Controllers
Laravel controllers are an essential feature in a Laravel framework.
0/1
Private: Laravel
About Lesson

The application structure in Laravel is the structure of directories, sub-directories, and files included in a project. Once we create a project in Laravel, we get an overview of the application structure as shown in the image here.

Laravel Application Structure

 

The analysis of directories and files, along with their functions are as follows −

app

The app directory contains the base code for your Laravel application. It contains events, exceptions, and middleware declarations. It holds other sub-directories for additional purposes.

  • Console – The Console directory contains all your project artisan commands.
  • Exceptions – The Exceptions directory holds your laravel project’s exception handling files, which handles all the exceptions thrown by your Laravel project.
  • Http – The Http directory holds different filters, requests, and controllers.
  • Providers – This directory includes all the service providers required to register events for core servers and to configure a Laravel application.

 

bootstrap

This directory encloses all the application bootstrap scripts. It contains a sub-directory namely cache, which includes all the files associated with caching a web application. You can also find the file app.php, which initializes the scripts necessary for bootstrap.

 

config

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

 

database

The database directory holds your database files.

It includes three sub-directories as given below −

  • seeds − This contains the classes used for the unit testing database.
  • migrations − This folder helps in queries for migrating the database used in the web application.
  • factories − This folder is used to generate a large number of data records.

 

public

It is the root directory that helps in initializing the Laravel application. It includes the following files and directories −

  • .htaccess − This file gives the server configuration.

  • javascript and CSS − These files are considered assets.

  • index.php − This file is required for the initialization of a web application.

 

resources

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

 

routes

The routes directory contains all your definition files for routing, such as console.php, api.php, channels.php, etc.

 

storage

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

 

test

The test directory contains all your test cases.

 

vendor

The vendor directory contains all composer dependency files.