Documentation Index
Fetch the complete documentation index at: https://kawax.biz/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Laravel’s default application structure is a sensible starting point for both small and large applications. You’re free to organise your application however you like — Laravel imposes almost no restrictions on where any given class is located, as long as Composer can autoload it.Root directory
When you create a new Laravel project, the following structure is generated:app/ directory
Contains the core code of your application. Almost all of your application’s classes live here, including controllers, models, and middleware.
By default it includes Http/, Models/, and Providers/ subdirectories. Additional subdirectories are created automatically when you generate classes with Artisan commands.
bootstrap/ directory
Contains the app.php file that bootstraps the framework, along with a cache/ directory that holds framework-generated files for performance optimisation (route and service caches).
config/ directory
Contains all of your application’s configuration files. It’s worth reading through these files to familiarise yourself with the available options.
database/ directory
Contains database migrations, model factories, and seeders. SQLite database files can also be stored here.
public/ directory
Contains the index.php file, which is the entry point for all requests entering your application. It also houses your assets — images, JavaScript, and CSS.
resources/ directory
Contains your views and raw, uncompiled assets such as CSS and JavaScript.
routes/ directory
Contains all route definitions for your application. Two route files are included by default: web.php and console.php.
| File | Purpose |
|---|---|
web.php | Routes for browser-facing pages. The web middleware group applies session handling, CSRF protection, and cookie encryption. |
console.php | Define closure-based Artisan commands. |
api.php | Stateless API routes. Add with php artisan install:api. |
channels.php | Register event broadcast channels. |
storage/ directory
Contains logs, compiled Blade templates, file-based sessions, file caches, and other files generated by the framework. It is split into app/, framework/, and logs/ subdirectories.
tests/ directory
Contains your automated tests. Starter examples for both Pest and PHPUnit are included out of the box.
vendor/ directory
Contains your Composer dependencies. Do not commit this directory to source control.
Inside app/
Most classes in the app directory can be generated with Artisan commands. To see what’s available, run:
Http/ directory
Http/ directory
Contains controllers, middleware, and form requests. Nearly all of the logic for handling requests entering your application lives here.
Models/ directory
Models/ directory
Contains all Eloquent model classes. Each database table has a corresponding model used to query and insert data.
Providers/ directory
Providers/ directory
Contains all service providers for your application. Service providers bootstrap the application by binding services into the container, registering events, and more.
Console/ directory
Console/ directory
Contains all custom Artisan commands. Generate new ones with
php artisan make:command.Exceptions/ directory
Exceptions/ directory
Contains your application’s custom exception classes. Generate them with
php artisan make:exception.Key files
.env file
Manages environment-specific configuration values such as database credentials and API keys. Values here are referenced from config/ files via the env() helper.
artisan file
The entry point for the Artisan command-line interface. Run commands with:
Next steps
Routing
Learn how to define routes and connect URLs to your application logic.