Instructions to enable maintenance mode in Laravel 8.

Tram Ho

The problem to share with you is when you enable maintenance mode in laravel 8 with the command php artisan down or Artisan::call("down"). At that time, if you go to any link of the website, you will only receive the following message “503 | SERVICE UNAVAILABLE”.

Now we want to access some of the links while maintenance mode is still on. For example, just access the admin page of the website, for example.

You guys come in: App/Http/Middleware/PreventRequestsDuringMaintenance.php

You change it back to:

The above code is meant to allow access to paths http://localhost/admin , http://localhost/admin/* in maintenance mode. (ex: * = san-pham || * = them-san-pham). Good luck

Share the news now