Then, once all of the providers have been registered, the boot method will be called on each provider. After instantiating the providers, the register method will be called on all of the providers. Laravel will iterate through this list of providers and instantiate each of them. All of the service providers for the application are configured in the config/app.php configuration file's providers array. Service providers are responsible for bootstrapping all of the framework's various components, such as the database, queue, validation, and routing components. One of the most important kernel bootstrapping actions is loading the service providers for your application. Feed it HTTP requests and it will return HTTP responses. Think of the kernel as being a big black box that represents your entire application. The method signature for the HTTP kernel's handle method is quite simple: it receives a Request and returns a Response. These middleware handle reading and writing the HTTP session, determining if the application is in maintenance mode, verifying the CSRF token, and more. The HTTP kernel also defines a list of HTTP middleware that all requests must pass through before being handled by the application. Typically, these classes handle internal Laravel configuration that you do not need to worry about. These bootstrappers configure error handling, configure logging, detect the application environment, and perform other tasks that need to be done before the request is actually handled. The HTTP kernel extends the Illuminate\Foundation\Http\Kernel class, which defines an array of bootstrappers that will be run before the request is executed. For now, let's just focus on the HTTP kernel, which is located in app/Http/Kernel.php. These two kernels serve as the central location that all requests flow through. 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. The first action taken by Laravel itself is to create an instance of the application / service container. The index.php file loads the Composer generated autoloader definition, and then retrieves an instance of the Laravel application from bootstrap/app.php. Rather, it is a starting point for loading the rest of the framework. The index.php file doesn't contain much code. All requests are directed to this file by your web server (Apache / Nginx) configuration. The entry point for all requests to a Laravel application is the public/index.php file. If you don't understand all of the terms right away, don't lose heart! Just try to get a basic grasp of what is going on, and your knowledge will grow as you explore other sections of the documentation. By getting to know the overall framework better, everything feels less "magical" and you will be more confident building your applications. The goal of this document is to give you a good, high-level overview of how the Laravel framework works. When you understand how your development tools function, you feel more comfortable and confident using them. When using any tool in the "real world", you feel more confident if you understand how that tool works.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |