agyanadda@gmail.com

Laravel Folder Structure

Laravel Basics 1 min read Updated Dec 2, 2026 Topic 3 of 31

A new Laravel project has many folders. You will work in only a few of them every day.

The important folders

Folder / file What goes there
app/Http/Controllers Controllers
app/Models Eloquent models (User, Post)
routes/web.php Web page routes
resources/views Blade templates (.blade.php)
database/migrations Table definitions
config Configuration files
public index.php, images, compiled CSS/JS
storage Logs, cache, uploaded files
vendor Packages installed by Composer
.env Environment settings and passwords

Request flow

Every request enters through public/index.php, then Laravel matches the URL in routes/web.php, runs a controller, and returns a view.

Tip

Only the public folder should be reachable from the web. On a live server, point the domain's document root at public, never at the project root.

Example

Example — Where each part of a page lives PHP
<?php
// routes/web.php            -> the URL
Route::get('/about', [PageController::class, 'about']);

// app/Http/Controllers/PageController.php -> the logic
public function about()
{
    return view('about');   // loads resources/views/about.blade.php
}

// resources/views/about.blade.php -> the HTML
// <h1>About us</h1>

view('about') looks for resources/views/about.blade.php. Dots are folders: view('pages.about') loads resources/views/pages/about.blade.php.

Test Yourself With Exercises

Exercise 1 Multiple Choice

Where are Blade view files stored?

Exercise 2 True / False

The vendor folder should be edited by hand to change package code.

Exercise 3 Fill in the Blank

Web page routes are defined in routes/___.php

Frequently Asked Questions

It contains only index.php and public assets. Keeping the rest of the project (including .env and your code) outside the web root means visitors cannot download it.