Challenge - 5 Problems
Laravel Debug Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🔧 Debug
intermediate2: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?Attempts:
2 left
💡 Hint
Think about what Laravel shows to protect sensitive info when debug is off.
✗ Incorrect
When APP_DEBUG=false, Laravel shows a generic error page to avoid exposing sensitive details. The detailed stack trace only appears when debug is on.
🔧 Debug
intermediate2: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?Attempts:
2 left
💡 Hint
This setting controls whether Laravel shows detailed errors or not.
✗ Incorrect
Setting APP_DEBUG=true enables detailed error messages and stack traces in Laravel, useful for development.
❓ component_behavior
advanced2: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?Attempts:
2 left
💡 Hint
Think about what detailed error info might reveal to outsiders.
✗ Incorrect
Enabling debug mode in production exposes sensitive information like file paths and code, which can be a security risk.
📝 Syntax
advanced2: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?
Attempts:
2 left
💡 Hint
Laravel recommends using the config helper for settings.
✗ Incorrect
The config('app.debug') call reads the debug setting properly. Using env() directly is discouraged outside config files.
❓ state_output
expert2: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 ...
Attempts:
2 left
💡 Hint
Remember what Laravel hides when debug is off.
✗ Incorrect
When APP_DEBUG=false, Laravel hides exception details and shows a generic error page to users.