General check in Laravel

Asked

Viewed 20 times

1

I have a site in Aravel with an administrative panel. I would like to know how to implement a general check. For example:

In my control panel I have a screen of site parameters, with a checkbox that marks whether the site is in maintenance or not. If so, the user will not be able to access any of the routes of the site as "/", "/contact", "/reservation". It will have to be redirected to the "/maintenance" route. How can I do a check in a single location to not need to duplicate code?

  • It is possible to implement a Middleware for this. Or use Laravel maintenance mode (https://laravel.com/docs/6.x/configuration#Maintenance-mode)

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.