Originally published on laravel.learnio.dev — part of the Laravel best practices course. View this lesson on the original site.

In this lesson

Laravel projects are opinionated by design. The folder layout is part of how the framework keeps teams consistent.

The top-level folders you will use first

  • app/ application code (controllers, models, services you add later)
  • routes/ route definitions (web.php, api.php)
  • resources/views/ Blade templates
  • config/ configuration files
  • database/ migrations, seeders, factories
  • public/ web entry point (index.php)
  • tests/ feature and unit tests
  • vendor/ installed dependencies (do not edit directly)
flowchart TD
  A[my-app/] --> B[app/]
  A --> C[routes/]
  A --> D[resources/views/]
  A --> E[config/]
  A --> F[database/]
  A --> G[public/]
  A --> H[tests/]
  A --> I[vendor/]

How to think about this structure

Use a simple mental model:

  • Entry and transport: public/, routes/
  • Application behavior: app/
  • Presentation: resources/views/
  • Persistence: database/
  • Configuration and operations: config/, tests/

When code feels "lost," start by checking if it is in the right layer first.

Practical check

In your project, open these files now:

  1. routes/web.php
  2. app/Http/Controllers/Controller.php
  3. resources/views/welcome.blade.php

This gives you a concrete map before the next lesson, where you run and inspect your first app flow.

From Laravel best practices — What is Laravel?