Laravel 6 Application Configuring Tutorial | Here we would love to share with you how you can configure your laravel application.
If you have downloaded laravel latest application, after that you want to connect your application to the database and set up other credentials in your laravel application project. So let’s start that tutorial.
Configuring in Laravel Project
Table of Contents
- Configuration changes in .env file
- Generate Application Key
- Maintenance Modes
Configuration changes in .env file
After successfully installed the laravel application, the next step is configuration .evn file. Let’s open .env file and setup database credentials like database name, database user name, database password, and host.
Generate Laravel Application Key
Configuration completed successfully of .evn file, Let’s open the command prompt and generate the laravel application key using this given below command.
php artisan key:generate
Maintenance Mode
When your application is in maintenance mode, a custom view will be displayed for all requests into your application. This makes it easy to “disable” your application while it is updating or when you are performing maintenance. A maintenance mode check is included in the default middleware stack for your application. If the application is in maintenance mode, a MaintenanceModeException
will be thrown with a status code of 503.
To enable maintenance mode, execute the down
Artisan command:
php artisan down
You may also provide message
and retry
options to the down
command. The message
value may be used to display or log a custom message, while the retry
value will be set as the Retry-After
HTTP header’s value:
php artisan down --message="Upgrading Database" --retry=60
Even while in maintenance mode, specific IP addresses or networks may be allowed to access the application using the command’s allow
option:
php artisan down --allow=127.0.0.1 --allow=192.168.0.0/16
To disable maintenance mode, use the up
command:
php artisan up
Server Error 500 when accessing Laravel 6 (Solve)
Download New Laravel Setup and Run, It will show server error 500 when accessing Laravel 6
If your using ubuntu machine. open your terminal and go to your project root directory and type the command in command prompt :
sudo chmod -R 777 storage
sudo chmod -R 777 bootstrap
Conclusion
In this laravel application configuration tutorial, you have learned how to configure your laravel application project.