How to enable and disable Debug mode on Laravel 4.2


One of the cool feature on laravel is that it has debug mode, when you are on development stage, it is always a good idea to enable debugging mode on laravel, later on production stage you can disable the debug mode.

To enable or disable debug mode on laravel 4.2, all you have to do is open the app.php which is inside the app/config folder, in there you can see the 'debug' array, change the value 'true' or 'false' and then save the file.
app/config/app.php

<?php return array( 
/* 
|-------------------------------------------------------------------------- 
| Application Debug Mode 
|-------------------------------------------------------------------------- 
| 
| 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. 
| 
*/
 
'debug' => true,

If the 'debug' => true, that means the debugging mode is enable, but if 'debug' => false, then the debug mode is disable. If the debugging mode is enable, you will get more detail information when error happens, therefore it is easier for you to solve the problem.

I highly recommend for you to enable debugging mode on laravel during development phase, it makes easier for developer to track issues and errors, of course on production environment you need to disable this feature, you don't want your users see the error message right?




~ keep coding ~

1 comments:


EmoticonEmoticon