More
In this tutorial, we will see all the important folders details which use during creating a project in laravel.
App is an application folder that has the entire source code of the project.
App folder contains console, exceptions, http, model, providers.
Artisan commands are included in the kernel.php file inside the console folder which is necessary for laravel.
Exceptions folder contains all the error handling method inside the handle.php file.
The folder has two subfolders for controller and middleware.
Controllers folder contains controllers file in which we can write all the request handling logic related to users, like- showing, creating, updating, deleting operations.
In the middleware folder, we can put all the middleware files that work after the request sent by the user and before loading your webpage.
For example, if you send a request to open any web page but if any restriction is written for your computer IP address in the middleware file, then you could not visit this web page.
kernel.php
In kernel.php file, which is inside the middleware folder is used to tell laravel about your middleware file because if you do not declare about your middleware file in the kernel.php then your middleware file not run.
The model folder consists of model files. Each table in the database has a corresponding "model" which allow to interact with the table.
The public folder consists of CSS, JS, image folder.
The resource folder has a 'view' subfolder which is used to keep all the HTML files inside it.
Routes folder have a file which is web.php used to bind URL to controller action.
It is a configuration file in which we can do all type of third party configuration task like, database configuration, all type of API configuration etc.