Home >> Laravel framework 5.0 >>
Laravel 5 request lifecycle
This Article will explain you, how laravel lifecycle works.
- The Very first thing happens in laravel to load public/index.php file and this file doesn't contain much code. It is simply a starting point for loading the rest of the framework.
- index.php file loads the Composer generated autoloader definition, and then retrieves an instance of the Laravel application from bootstrap/app.php script. The first action taken by Laravel itself is to create an instance of the application/service container.
- Next, the incoming request is sent to either the HTTP kernel or the console kernel, depending on the type of request that is entering the application .These two kernels serve as the central location that all requests flow through. For now, let's just focus on the HTTP kernel, which is located in app/Http/Kernel.php
- HTTP kernel's handle method is quite simple: receive a Request and return a Response.
- Once the application has been bootstrapped and all service providers have been registered, the Request will be handed off to the router for dispatching.
You can check request lifecycle in more details on laravel official site