TechvBlogs
Published in

TechvBlogs

How to Enable and Disable Debug Mode in Laravel

Nov 03, 2021, Originally published at techvblogs.com ・2 min read

Debugging is a helpful feature for developers to identify the causes of issues. Most of the modern application frameworks provide you the option to enable debug mode including Laravel. It is a good idea to keep enabling debug mode in your development environment. In your production environment, this value should always be false.

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.

In this blog, you will learn how to enable and disable debug mode in Laravel. Having a debug mode is very important in order to show errors during local development.

Enable Debug

Laravel provides 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.

APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
LOG_CHANNEL=single

Disable Debug

Set the APP_DEBUG environment variable value to false in the .env environment configuration file.

APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=false
APP_URL=http://localhost
LOG_CHANNEL=single

Enable or disable debug mode using app.php

Open the 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 disabling debug mode default it will show false.

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

Enable Debug

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

Disable Debug

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

Thank you for reading this blog.

--

--

--

We are sharing Blogs that are related to 🌍 Web and 📱 Mobile Applications issues and examples of Development. We are share blogs related to Laravel, PHP, CodeIgniter, HTML, CSS, Bootstrap, Javascript, jQuery, MySQL, MongoDB, Node.js, Vue.js, Nuxt.js.

Recommended from Medium

Build a JS Interpreter in JavaScript Using Acorn as a Parser

CS373 Fall 2020: Alexy Correa

Cotoami, an Experimental Note-taking App Focusing on Connecting

Methods to access custom email account

cpanel login page

How To deal with upload/download files Spring boot Api & React

Solr + Python — A Tutorial

Databases for Windows Desktop Development: Welcome to the Jungle

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Smit Pipaliya

Smit Pipaliya

I am Senior Developer at ServerAvatar Technology.

More from Medium

Add And Store Data In Laravel 8

Laravel 8

What is the Laravel Seeder and how it works?

Laravel 9