After installing Laravel, you might open your project and see many folders. Don’t worry! Each folder has a purpose. Let’s break it down.
1. app/
The app folder contains the core code of your application:
- Models: Represent your database tables.
- Http: Controllers, middleware, and requests.
- Console: Commands for Artisan CLI.
Think of app as the “brain” of your Laravel project.2. bootstrap/
- Contains files to start Laravel framework.
- The
cachefolder stores compiled configurations and routes for faster performance.
3. config/
- All configuration files for your app live here.
- Example:
app.php,database.php,mail.php.
Tip: Change environment-specific settings in .env instead of directly editing these files.4. database/
- Migrations: Manage database schema.
- Seeders: Fill tables with test data.
- Factories: Generate fake data for testing.
5. public/
- The entry point of your application (index.php).
- Place CSS, JS, images, and uploaded files here.
- All URLs are served from this folder.
6. resources/
- Views: Blade templates for your frontend.
- CSS/JS: Assets before compilation.
- lang: Translation files.
7. routes/
- Define all your application routes here:
web.php→ Routes for web pages.api.php→ Routes for APIs.
8. storage/
- Stores logs, cache, and uploaded files.
- Subfolders:
app,framework,logs.
9. tests/
- Write tests for your app to ensure everything works.
- Includes Feature and Unit tests.
10. vendor/
- Composer dependencies are stored here.
- Don’t edit anything inside this folder.
Tip for Beginners:
Think of Laravel as a “well-organized city” where each folder has a specific role. Once you understand it, navigating your project becomes much easier!
Category: Laravel
Tags: #Laravel Guide
2 Likes 0 Comments 18 Views
Leave a comment
Leave a Reply