0
0
Laravelframework~20 mins

Debug mode in Laravel - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Laravel Debug Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🔧 Debug
intermediate
2:00remaining
What error message appears when debug mode is off and an exception occurs?
In Laravel, if APP_DEBUG is set to false in the .env file, what will the user see when an exception happens?
AThe application crashes with a blank white screen
BA detailed stack trace with error message and code lines
CThe raw exception message printed on the screen
DA generic error page with a simple message like 'Whoops, something went wrong.'
Attempts:
2 left
💡 Hint
Think about what Laravel shows to protect sensitive info when debug is off.
🔧 Debug
intermediate
2:00remaining
Which .env setting enables detailed error messages in Laravel?
To see detailed error messages and stack traces during development, which setting in the .env file must be set?
AAPP_DEBUG=true
BAPP_ENV=production
CAPP_LOG_LEVEL=error
DAPP_DEBUG=false
Attempts:
2 left
💡 Hint
This setting controls whether Laravel shows detailed errors or not.
component_behavior
advanced
2:00remaining
What happens if you set APP_DEBUG=true in production?
If you accidentally set APP_DEBUG=true on a live Laravel site, what is the likely outcome when an error occurs?
AThe application crashes and stops responding
BUsers see detailed error info including file paths and code, risking security
CErrors are logged silently without showing anything to users
DThe site automatically disables debug mode for security
Attempts:
2 left
💡 Hint
Think about what detailed error info might reveal to outsiders.
📝 Syntax
advanced
2:00remaining
Which code snippet correctly reads the debug mode setting in Laravel?
Which of the following PHP code snippets correctly checks if debug mode is enabled in Laravel?
Aif (config('app.debug')) { /* debug is on */ }
Bif (env('APP_DEBUG') == true) { /* debug is on */ }
Cif (app()->debug) { /* debug is on */ }
Dif (getenv('APP_DEBUG') === 'true') { /* debug is on */ }
Attempts:
2 left
💡 Hint
Laravel recommends using the config helper for settings.
state_output
expert
2:00remaining
What is the output of this Laravel error page when APP_DEBUG=false?
Given the following Laravel error page snippet, what will the user see if APP_DEBUG=false?
Exception: Division by zero in Calculator.php line 42

Stack trace:
#0 ...
AThe full exception message and stack trace as shown
BA blank page with no content
CA simple error page with message 'Whoops, something went wrong.' without details
DA JSON response with error details
Attempts:
2 left
💡 Hint
Remember what Laravel hides when debug is off.