Field Manual PHP / Laravel reference
← Laravel

Project structure

Laravel separates routes, HTTP handling, models, views, and database changes.

What it is

Laravel separates routes, HTTP handling, models, views, and database changes.

When to use it

Know where to implement the next change.

Syntax

routes/web.php     // session, cookies, CSRF
app/Http/Controllers
app/Http/Requests
app/Models
resources/views
database/migrations
tests/Feature

Example

// A small feature:
// routes/web.php -> OrderController
// StoreOrderRequest validates input
// Order persists data
// resources/views/orders/show.blade.php renders output

Common mistakes

Do not add repositories or services without a concrete responsibility.

Related topics

Request/response structure