Short answer
It starts in index.php, loads the Autoloader, creates the application instance and passes the request to the HTTP Kernel, boots Service Providers, runs Middlewares, routes to a Controller, and returns a response.
Explanation
The request enters through public/index.php, which loads the Composer autoloader and calls bootstrap/app.php to create the application instance (Application Container). In Laravel 11 and later, index.php calls handleRequest() on the application; internally, this passes the request to the HTTP Kernel, which runs Bootstrappers to load configuration and handle errors, then registers and boots Service Providers (through register, then boot). The request then passes through global and route Middlewares to the Controller. The result becomes a Response and returns through the same Middlewares to the browser.
Code example
// public/index.php (Laravel 11+)
use Illuminate\Http\Request;
define('LARAVEL_START', microtime(true));
require __DIR__.'/../vendor/autoload.php';
(require_once __DIR__.'/../bootstrap/app.php')
->handleRequest(Request::capture()); // Laravel 10 and earlier: $kernel->handle($request)->send()Common mistakes
- Putting code that depends on other services in a Service Provider's register() method before the boot() phase is complete.
Follow-up questions
- How does Laravel implement its Middleware Pipeline, and what is the TerminableMiddleware interface?
- How did Laravel 11 simplify application startup by removing the Http Kernel and moving configuration into bootstrap/app.php?