🎯 Laravel Full Structure

📁 app/ – Main Application Code

This folder has all the main logic of your project.

Folder/File Meaning Why it's used Example
Http/Controllers/ Handles user requests To control what happens when someone visits a URL php artisan make:controller PageController
Http/Middleware/ Filters requests To check something before opening the page Like login check
Models/ Talks to the database To get or save data in the database php artisan make:model Post
Console/ Custom commands For background tasks or scheduled work Send daily emails
Exceptions/ Handles errors To show nice error messages Customize error pages
Providers/ Starts services Laravel auto-loads this System use only

📁 bootstrap/

File Meaning Why it's used
app.php Laravel starter file Runs Laravel when project starts

📁 config/ – All Settings

This folder stores settings like app name, DB, mail, etc.

File Controls what?
app.phpApp name, timezone
database.phpDatabase connection info
mail.phpEmail settings
auth.phpLogin system
cache.php, session.phpCaching and session control

config('app.name') // Shows your app name

📁 database/

Folder Use
migrations/To create tables
seeders/To insert demo data
factories/To create fake data

📁 lang/

This folder is for multiple languages.
You can add Hindi, English, etc.

__('messages.welcome') // Shows translated text

📁 public/

This is the main website folder. Everything that users can see (like images, CSS, JS) is here.

File Use
index.phpEntry file – opens Laravel
css/, js/, images/All frontend files

📁 resources/

This is for frontend design.

Folder Use
views/All Blade files like home.blade.php
js/JavaScript files
sass/CSS (with SCSS) – optional

return view('home')

📁 routes/

This folder contains website URLs.

File Use
web.phpAll normal URLs like /about
api.phpFor mobile/API routes
console.phpCustom artisan command routes
channels.phpReal-time notifications

Route::get('/about', [AboutController::class, 'index'])

📁 storage/

Folder Use
logs/Error log files
app/Uploaded files
framework/Cache, sessions, views, etc.

Storage::put('myfile.txt', 'Hello')

📁 tests/

This is for testing your code.

Folder Use
Feature/Big functionality test
Unit/Small logic/function test

php artisan test

🗂️ Important Root Files