What is the Request Lifecycle in laravel?


In the world have everything has its own lifecycle. when you relate this is from real-world its will be less, easy to be understood.

  Now we are going to learn about The Laravel Request lifecycle.

  1. In the all Laravel application public/index.php its entry points. All requests are directed to this file by your web server configuration. 
  2. The index.php file loads the Composer generated autoloader definition and then retrieves an instance of the Laravel application from bootstrap/app.php. The first action taken by Laravel itself is to create an instance of the application/service container.

       3. HTTP / Console Kernels:   

       4. Service Providers: 

               config/app.php

        5. Routing :

                One of the most important service providers in your application is the    App\Providers\RouteServiceProvider. 

                 This service provider loads the route files contained within your application's routes directory.

         6. Finishing Up: 

               Once the route or controller method returns a response, the response will travel back outward through the route's middleware,

                giving the application a chance to modify or examine the outgoing response. Finally, once the response travels back through the middleware, the HTTP kernel's handle method returns the response object and the index.php file calls the send method on the returned response. The send method sends the response content to the user's web browser.