🧭 Navigating the Laravel 12 Project Structure
Laravel 12 features a clean and well-structured directory structure that aids in maintainability and scalability. Below is a description of the primary directories:
1. app/ – Core Application Code
This is the brain of your application. It, by default, includes:
Other folders like Console/, Events/, Jobs/ can also be created, still in the course of generating specific classes with the command tools of Artisan
2. bootstrap/ – Application Bootstrapping
3. config/ – Configuration Files
It is where all the configuration files are situated for the application e.g., app.php, database.php, and mail.php. Each file gives you the freedom to adjust different parts of the framework's functioning.
4. database/ – Database Migrations and Seeders
Includes:
5. public/ – Files Located Publicly
The access point for each of the requests that are coming into the application (index.php). This folder is also used to hold other files such as pictures, JavaScript, and CSS. Files and folders from this directory are easily accessible by anyone.
Recommended by LinkedIn
6. resources/ – Views and Assets
Consists of this:
7. routes/ – Route Definitions
Identify the routes for the application:
8. storage/ – Compiled Templates and Logs
It is where the server keeps caches, application logs, file sessions, and Blade templates that have been compiled. And this directory is writable by the web server.
9. tests/ – Automated Tests
It contains:
Ensure unit and feature tests of the application to check that it behaves as expected. Laravel 12 supports both PHPUnit and Pest testing frameworks.
10. vendor/ – Composer Dependencies
It contains all the composer-managed packages and dependencies. In the usual case, you don't have to change anything here.
🆕 Notable Changes in Laravel 12