0% found this document useful (0 votes)
54 views3 pages

Laravel Folder Structure Guide

The document provides an overview of the folder structure in a Laravel project, detailing the purpose of each directory and key files. Key directories include 'app/' for core application code, 'config/' for configuration files, and 'public/' as the web root. It also highlights the importance of the '.env' file for environment variables and the 'vendor/' directory for third-party packages.

Uploaded by

itsparagp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views3 pages

Laravel Folder Structure Guide

The document provides an overview of the folder structure in a Laravel project, detailing the purpose of each directory and key files. Key directories include 'app/' for core application code, 'config/' for configuration files, and 'public/' as the web root. It also highlights the importance of the '.env' file for environment variables and the 'vendor/' directory for third-party packages.

Uploaded by

itsparagp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Laravel Folder Structure Overview

When you create a new Laravel project, it generates several directories and files. Each of these has

a specific purpose.

1. app/

- Contains your application's core code.

- Default namespace for PHP code.

Subfolders:

- Console/: Artisan commands.

- Exceptions/: Custom error handling.

- Http/: Controllers, Middleware, and Requests.

- Controllers/: Application logic.

- Middleware/: HTTP request filters.

- Models/: Eloquent models (e.g., User.php)

2. bootstrap/

- Initializes the Laravel framework.

- app.php file bootstraps the framework.

- cache/ directory for performance.

3. config/

- Configuration files for database, mail, app, etc.

- Common files: app.php, database.php, auth.php

4. database/
- Database-related files.

Subfolders:

- migrations/: Version control for database schema.

- factories/: Dummy data generators.

- seeders/: Insert default/test data.

5. public/

- Web root folder.

- Only this folder is publicly accessible.

- Contains index.php, CSS, JS, images.

6. resources/

- Contains views, raw assets, and language files.

Subfolders:

- views/: Blade templates.

- lang/: Language translation files.

- js/, sass/: Frontend assets.

7. routes/

- Route definition files.

Files:

- web.php: Web routes (sessions, CSRF).

- api.php: API routes (stateless).

- console.php: Artisan command routes.

- channels.php: Broadcasting event routes.

8. storage/
- Logs, file uploads, and cache.

Subfolders: app/, logs/, framework/

9. tests/

- Unit and feature tests using PHPUnit.

10. vendor/

- Third-party packages installed by Composer.

11. .env

- Environment variables like DB credentials, app name.

- Should not be committed to Git.

You might also like