Laravel Application Configuration Settings Tutorial

The configuration of the Laravel application offers by means of the ‘config‘ subdirectory, which holds the whole configuration file associated to our Laravel project. This subdirectory retains files like a database, mailing, services, and session-based configuration files with an extension of .config. The configuration of the Laravel project allows you to define configuration per-environment. In this tutorial, we’ll study concerning the totally different configurations and the way the basic setup is done in Laravel.

Configure Basic in Laravel

If we’re new to Laravel, then we need to know that you’ve got the availability to create configuration files for the Laravel application. After installing Laravel, it’s good to carry out the permission writing to your storage directory together with the bootstrap/cache.

Next, it’s a must to do is, generating the application key for session securing and encrypted data keys also. In case, the root directory does not have the .env file, in that case, we’ll have to rename the file .env.example to .env and run the command talked about below the place we have put in the Laravel:

php artisan key: generate

We can see within the .env file the newly generated key. Moreover, it’s also possible to configure the time zone as well as a locale within the config/app.php file of our project.

'env' => env('APP_ENV', 'production'),
config(['app.timezone' => 'Asia/Kolkata']);

Configure Enviornment

Laravel permits us to run an software for diverse environments like testing, production, and so forth. For configuring your software’s environment, we have to the .env file, which is within the root directory of the project. When we install composer for Laravel, then this file will get generated or created automatically by the composer itself, however when we do not install, then need to rename the particular file with the name .env.example to .env only.

Configuring the Database

We can configure the database to our software utilizing the config/database.php file of our project. Setting the configuration constraint utilized by various databases may also be executed, and furthermore, Laravel also allowed us to make use of the default one as nicely.

Maintenance Modes

Websites are repeatedly modified. As s a developer for this, it’s a must to put your web site in maintenance mode. In this superior framework, it turns into simpler to do this through the use of two artisan commands. Let’s see the best way to use the instructions:

For beginning your project maintenance method, the next command is required:

php artisan down

After changing the required stuff, when it is time to re-run your project, the following command is needed:

php artisan up

<— Previous Tutorial Next Tutorial —>

LEAVE A REPLY

Please enter your comment!
Please enter your name here

564FansLike

Related Articles

Concept of Session in Laravel Tutorial

Sessions are used to store details about the user throughout the requests. Laravel supplies various drivers like file, cookie, apc, array, Memcached, Redis, and database to handle session data. By default, file driver is used as a result of it's light-weight....

Laravel Url Generation Tutorial

Our web application revolves around routes and URLs. After all, they're what direct our users to our pages. At the end of the day, serving pages is what any web application should do. Our users may...

Concept of Laravel Views Tutorial

In MVC framework, the letter "V" stands for Views. It separates the application logic and presentation logic. Views are saved in resources/views listing. Generally, the view contains the HTML which might be served by the application.
WP2Social Auto Publish Powered By : XYZScripts.com