I am reading the documentation at Laravel under the heading Architecture Concepts
.
I am unable to understand application and usage of Console Kernel .(not the Http Kernel) However, I googled out and found these links
https://laravel.com/api/5.2/Illuminate/Foundation/Console/Kernel.html https://laravel.com/api/5.3/Illuminate/Contracts/Console/Kernel.html
But I can't understand anything with that API !
devquora. Posted On: Jun 08, 2021. The HTTP Kernel is used to process requests that come in through the web (HTTP) whereas the Console Kernel is used when you interact with your application from the command line.
The console kernel is defined in the app/Console/Kernel. php (this will be referred to as the application console kernel) file. The kernel class that exists in that file extends Laravel's console kernel (which can be found in the vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.
Using console route, you can create your own artisan commands. It is registered inside app/Console/kernal.php file. Let's say you want to alter column in your table, you can register in console route and run queries.
Laravel Tinker allows you to interact with a database without creating the routes. Laravel tinker is used with a php artisan to create the objects or modify the data. The php artisan is a command-line interface that is available with a Laravel. Tinker is a command tool that works with a php artisan.
The HTTP Kernel is used to process requests that come in through the web (HTTP). Website requests, AJAX, that kind of stuff.
The Console Kernel is used when you interact with your application from the command line. If you use artisan
, or when a scheduled job is processed, or when a queued job is processed, all of these actions go through the Console Kernel.
Basically, if you go through index.php
, you'll be using the HTTP Kernel. Most everything else will be using the Console Kernel.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With