Think about what maintenance mode is for: temporarily stopping access.
Laravel shows a 503 Service Unavailable page by default during maintenance mode to inform users the site is temporarily down.
Think about the simplest command to stop the app temporarily.
The correct command is php artisan down. It puts the app into maintenance mode.
php artisan down but users still access the site normally. What could cause this?Maintenance mode creates a special file to signal the app is down.
Laravel uses a file in storage/framework/down to detect maintenance mode. If missing or not writable, maintenance mode won't activate.
php artisan down --secret="abc123". What happens when users visit the site?The secret token allows bypassing maintenance mode for special URLs.
The --secret option creates a special URL that bypasses maintenance mode, letting authorized users access the site.
Think about how Laravel detects maintenance mode using a file on disk.
Laravel checks for a file on disk to detect maintenance mode. In multiple servers, each must have that file or share it via network storage.