Getting non static function statically is called Facades. Lets set the cache like below in our web route cache()->set(‘name’,”navid”); and get it using dd() dd(cache()->get(‘name’)); Result : “navid” As we can see cache() is not a static method. If we Ctrl+Left Mouse Click on cache(),it will go to that method and we can see the […]
Laravel Service Providers
All services are added to service container using Service Provider. Every service of your application is provided using service provider. Lets open to bootstrap/app.php.We will see below code. $app = new Illuminate\Foundation\Application( $_ENV[‘APP_BASE_PATH’] ?? dirname(__DIR__) ); If we Ctrl+left mouse click on Application, class Application will open. Here Laravel is binding or registering serviceprovider […]
Request lifecycle of Laravel
We should understand Laravel’s Request lifecycle so that we may interact with/change request/response data or do anything else. First Step Every server, including Apache, that makes a request redirect to the public/ index The index file loads the autoload function and creates an instance of the Laravel application. HTTP/Console kernels Because HTTP/kernels or console kernels […]