Posts

Showing posts with the label Laravel

How does request life cycle work in Laravel?

The entry point for all requests to a Laravel application is the public/index.php file. All requests are directed to this file by your web server (Apache / Nginx) configuration. The index.php file doesn't contain much code it's just starting point for loading the rest of the framework. The 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. HTTP / Console Kernels 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 the app/Http/Kernel.php. The HTTP kernel extends the Illuminate\Foundation\Http\ Kernel class, which defines an array

What is Laravel localization? When we can us this?

When we are developing a multi-language site at that time we use laravel localization. Localization in Laravel in it's simplest term means changing the application's default language to the language preferred by the user. There are two different ways we can achieve localization in Laravel: 1. Using Short Keys 2. Using Translation Strings as Keys

Laravel interview questions

What is PHP artisan in Laravel? PHP is artisan is command line interface included with Laravel. It provides number of commands while developing laravel applications. Why we use Laravel? Progressive Framework Scale able Framework Large community  ORM Support Authentication Support Database Migrations Laravel Thinker and Seeder How can we configure variable in .env file? Set value in .env file => APP_Name = "Test_Laravel_Framewrok" Accessing value from .env file => env('APP_Name') How to set & get config variable in Laravel? set value in config file => config(['app.timezone' => 'YOUR TIME ZONE']); get value from config file => $value = config('app.timezone'); How can we determine current environment? Using - App::environment(); we can determine current environment. Ex - App::environment(['local', 'staging']) How to set debug mode in Laravel? In .env file we have env variable called "APP_DEBUG", If it