0
0
Laravelframework~20 mins

Maintenance mode in Laravel - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Laravel Maintenance Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
component_behavior
intermediate
1:30remaining
What happens when Laravel is in maintenance mode?
When you enable maintenance mode in Laravel, what will users see when they visit your application?
AUsers can access the site normally without any interruption.
BUsers see a default 503 Service Unavailable page until maintenance mode is disabled.
CUsers get redirected to the login page automatically.
DUsers see a 404 Not Found error page.
Attempts:
2 left
💡 Hint

Think about what maintenance mode is for: temporarily stopping access.

📝 Syntax
intermediate
1:00remaining
Which command enables maintenance mode in Laravel?
Select the correct Artisan command to put a Laravel application into maintenance mode.
Aphp artisan enable:maintenance
Bphp artisan maintenance:enable
Cphp artisan maintenance:on
Dphp artisan down
Attempts:
2 left
💡 Hint

Think about the simplest command to stop the app temporarily.

🔧 Debug
advanced
2:00remaining
Why does the maintenance mode not activate after running the command?
You run php artisan down but users still access the site normally. What could cause this?
AThe storage/framework/down file is missing or not writable.
BThe application is running in local environment which ignores maintenance mode.
CThe web server cache is not cleared, so old pages are served.
DThe .env file has APP_DEBUG=true which disables maintenance mode.
Attempts:
2 left
💡 Hint

Maintenance mode creates a special file to signal the app is down.

state_output
advanced
1:30remaining
What is the effect of the --secret option in Laravel maintenance mode?
You run php artisan down --secret="abc123". What happens when users visit the site?
AUsers can access the site normally only if they visit the URL with the secret token.
BAll users see the maintenance page regardless of the URL.
CThe secret token disables maintenance mode immediately.
DThe secret token is used to send email notifications about maintenance.
Attempts:
2 left
💡 Hint

The secret token allows bypassing maintenance mode for special URLs.

🧠 Conceptual
expert
2:30remaining
How does Laravel handle maintenance mode in a load-balanced environment?
In a load-balanced setup with multiple servers, what must you do to ensure maintenance mode works correctly across all servers?
AOnly run <code>php artisan down</code> on the main server; others detect it automatically.
BMaintenance mode is not supported in load-balanced environments.
CRun <code>php artisan down</code> on each server or share the storage/framework/down file via shared storage.
DDisable load balancing during maintenance mode to avoid inconsistencies.
Attempts:
2 left
💡 Hint

Think about how Laravel detects maintenance mode using a file on disk.