🎯 Laravel Full Structure
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 |
| File | Meaning | Why it's used |
|---|---|---|
| app.php | Laravel starter file | Runs Laravel when project starts |
This folder stores settings like app name, DB, mail, etc.
| File | Controls what? |
|---|---|
| app.php | App name, timezone |
| database.php | Database connection info |
| mail.php | Email settings |
| auth.php | Login system |
| cache.php, session.php | Caching and session control |
config('app.name') // Shows your app name
| Folder | Use |
|---|---|
| migrations/ | To create tables |
| seeders/ | To insert demo data |
| factories/ | To create fake data |
This folder is for multiple languages.
You can add Hindi, English, etc.
__('messages.welcome') // Shows translated text
This is the main website folder. Everything that users can see (like images, CSS, JS) is here.
| File | Use |
|---|---|
| index.php | Entry file – opens Laravel |
| css/, js/, images/ | All frontend files |
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')
This folder contains website URLs.
| File | Use |
|---|---|
| web.php | All normal URLs like /about |
| api.php | For mobile/API routes |
| console.php | Custom artisan command routes |
| channels.php | Real-time notifications |
Route::get('/about', [AboutController::class, 'index'])
| Folder | Use |
|---|---|
| logs/ | Error log files |
| app/ | Uploaded files |
| framework/ | Cache, sessions, views, etc. |
Storage::put('myfile.txt', 'Hello')
This is for testing your code.
| Folder | Use |
|---|---|
| Feature/ | Big functionality test |
| Unit/ | Small logic/function test |
php artisan test