Registering PreventRequestsDuringMaintenance Middleware Laravel 11 #10605
-
I'm following this tip: https://statamic.dev/tips/excluding-the-control-panel-from-maintenance-mode |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
What have you tried? |
Beta Was this translation helpful? Give feedback.
-
Well I'm confused about if I even need to and I'm not sure the docs are up to date so I haven't tried anything. I did create the Middleware folder and put that class in there. I also don't know about what I would put there to register it. Would it be this:
|
Beta Was this translation helpful? Give feedback.
-
Oh so I don't even have to put that preventRequestsDuringMaintenance.php in the Middleware folder? This is on a fresh V5 install so it's the new skeleton... |
Beta Was this translation helpful? Give feedback.
In
bootstrap/app.php
you should be able to do something like this in laravel 11 with the new skeleton:If you have the old skeleton I think you just have to change the usage of the existing
PreventRequestsDuringMaintanance
with your own. In one of my projects I have done it like this in theHttp/Kernel
file: