1.controller and blade file resides under which directory in laravel
2.migration and seeds resides under which directory in laravel
3.databse.php and service.php resides under which directory in laravel
Laravel Application Structure
The application structure is the structure of folders, sub-folders, and files available in the project. Once the project is created in Laravel, the application structure generated as shown in the below screenshot:
Laravel's app directory
The app folder is one of the major folders in Laravel as most of the code is written in the app folder. The App folder contains the following sub-folders:
Console folder contains the artisan commands required for Laravel. It contains the commands which are declared with the appropriate signature.
Exceptions folder contains the various exception handlers. It handles the exceptions thrown by the Laravel project. The Exceptions directory contains the methods that handle the exceptions.
The Exceptions directory contains the file handle.php that handles all the exceptions.
The http folder is a sub-folder of the app folder. It has sub-folders such as controllers, middleware, and requests. Laravel follows the MVC architecture, so http includes controllers, views, and requests.
Middleware: It is a sub-folder of the http directory. It provides a filter mechanism and communication between request and response.
Requests: It is a sub-folder of http which includes all the requests of an application.
The Providers directory is used to contain all the service providers that are required to register events for core servers and provides configuration for Laravel application.
The bootstrap directory holds the files that are required to bootstrap the Laravel application and to configure auto-loading. The bootstrap folder contains a sub-folder cache used for caching a web application. It also contains the file app.php that initializes the scripts required for bootstrap.
The above screen shows the structure of the bootstrap directory. It contains one folder, i.e., cache and two files, app.php and autoload.php.
Laravel's config directory
The config's directory contains the various configuration files required for the Laravel application. Various files are available inside the config's directory shown in the below screenshot, and each file performs their functionalities as per their names.
The database directory consists of three sub-folders:
Factories: The factories folder is used to generate a huge number of data records.
Migrations: The migrations folder is used to migrate the database in web application.
Seeds: The seeds folder contains the classes used to perform unit testing database.
Laravel's Public directory
The public directory is a root folder that contains the front controllers used for initializing the Laravel web application. Following are the sub-folders of a public directory:
.htaaccess: It is used for the server configuration.
index.php: This file is used for initializing the web application.
The structure of the public directory is shown in the below screenshot:
The resource directory holds the files used to enhance the web application. It contains the following sub-folders:
Assets: This folder contains the files such as LESS and SCSS used for styling the web application.
Lang: The lang folder provides configuration for localization or internationalization.
Views: The views folder contains html files used to interact with the end-users, and it also plays an important role in MVC architecture.
The storage directory contains those files which are required frequently when a Laravel project is running. It contains the following folders:
App: It contains the files which are called frequently.
Framework: It contains templates, filed based sessions, and file cache.
Logs: This folder tracks the exceptions and error logs.
The structure of the storage directory is shown in the below screenshot: