Laravel Project Structure
A scalable and maintainable folder structure for Laravel applications
File Structure
- app
- Http
- Models
- Providers
- bootstrap
- config
- database
- public
- resources
- routes
- storage
- tests
- vendor
- .env
- composer.json
- README.md
Directory Structure Explanation
app/
The main application folder containing all the core logic of the Laravel application.
app/Http/
Contains controllers, middleware, and other HTTP-related logic.
app/Models/
Contains Eloquent models for database interaction.
app/Providers/
Contains service providers for bootstrapping the application.
bootstrap/
Contains the app.php file which bootstraps the framework and handles autoloading.
config/
Contains configuration files for the Laravel application.
database/
Contains database migrations, seeders, and factories for managing the database schema and data.
public/
Contains the entry point (index.php) and assets like CSS, JavaScript, and images.
resources/
Contains views, language files, and raw assets like Sass and JavaScript.
routes/
Contains all the route definitions for the application.
storage/
Contains logs, compiled Blade templates, file uploads, and other generated files.
tests/
Contains automated tests for the application.
vendor/
Contains Composer dependencies installed for the Laravel project.
.env
Stores environment-specific configuration like database credentials.
composer.json
Defines the project dependencies and scripts for Composer.
README.md
Documentation file providing an overview and instructions for the project.