Navigate back to the homepage

How to enable and disable debug mode in laravel

Infinitbility
Laravel
August 31st, 2021 · 1 min read
How to enable and disable debug mode in laravel

Hello Friends 👋,

Welcome To Infinitbility! ❤️

This tutorial help you to enable and disable debug mode in laravel, here you will get two ways to enable and disable debug mode in laravel.

Laravel provide app debug mode feature for check errors and in your application code, it help us to know what is a error and where it is? but some time we want disable debug mode because it’s reveal credentials mainly in production and in stage environment.

Now we are going to learn how we change app debug mode in laravel and solution work

What is debug mode in laravel?

When your application is in debug mode, detailed error messages with stack traces will be shown on every error that occurs within your application. If disabled, a simple generic error page is shown.

Enable or disable debug mode using .env file

Laravel provide APP_DEBUG flag in .env file to handle application debug mode, default it true and when you change to false it means you are disabling debug mode.

Search APP_DEBUG key in .env file and change true to enable debug mode and false for disable debug mode.

1APP_NAME=Laravel
2APP_ENV=local
3APP_KEY=base64:3FwqSZXTAfscqdzahG1P553GEQQBMBj+ecRDUUAEtrY=
4APP_DEBUG=true
5APP_URL=http://localhost
6
7LOG_CHANNEL=stack

Enable ENV APP_DEBUG Example

1APP_DEBUG=true

Disable ENV APP_DEBUG Example

1APP_DEBUG=false

Enable or disable debug mode using config app.php

Open app.php file located in your config/app.php laravel project. Search for debug key and change true to enable debug mode and false for disable debug mode default it will show false.

1/*
2 |--------------------------------------------------------------------------
3 | Application Debug Mode
4 |--------------------------------------------------------------------------
5 |
6 | When your application is in debug mode, detailed error messages with
7 | stack traces will be shown on every error that occurs within your
8 | application. If disabled, a simple generic error page is shown.
9 |
10 */
11
12 'debug' => env('APP_DEBUG', false),

Enable Config debug Example

1'debug' => env('APP_DEBUG', true),

Disable Config debug Example

1'debug' => env('APP_DEBUG', false),

Thanks for Reading…

Join our email list and get notified about new content

No worries, I respect your privacy and I will never abuse your email.

Every week, on Tuesday, you will receive a list of free tutorials I made during the week (I write one every day) and news on other training products I create.

Looking For React Native Tutorial?

we are trying to create the best Tutorial for react native developers.

When you want a daily updates about React Native Tutorial or infinitbility update subscribe to our newsletter.

Read React Native Tutorial

Request New Tutorial or Article on mail [email protected]

Tutorials

React Native

Categories

More articles from Infinitbility

How to check if an object is empty in javascript

How to check if an object is empty in javascript

check object is empty or not in javascript

August 30th, 2021 · 1 min read
How to get file details in react native

How to get file details in react native

React Native FS stat example to get file name, file type, file created date, file last modified date, and file size.

August 29th, 2021 · 1 min read
© 2020–2021 Infinitbility
About
Link to $https://medium.com/infinitbilityLink to $https://www.facebook.com/InfinitbilityLink to $https://github.com/infinitbilityLink to $https://twitter.com/infinitbilityLink to $https://www.buymeacoffee.com/infinitbilityLink to $mailto:[email protected]