Laravel Access to Maintenance Mode using Secret Code
Hello Artisans, Toady I'll talk about one of the new features of Laravel, access to application through maintenance mode token. So, previously if we want to go to the maintenance mode and if anyone needs a access to the application, we need to allow the specific IP address via the below command.
php artisan down --allow=127.0.0.1
It's quite an complex, because every time you need to check the IP address and then request for admin to access the application with your IP. But here comes the secret token. Where you can set your application to the maintenance mode using a secret key with artisan down command. So, your final command will be
php artisan down --secret="shoutsdev"
What will command is do, that you application go to the maintenance mode and this secret which we provide as an example shoutsdev, it will set with a token under storage/framework/down, where you can find all of your information. The file looks like below.
When you will share this token with anyone, who wants to access to you r application he can visit to your application by entering the below link
Behind The Scene
Larvel store the key in your browser cache called laravel_maintenance which let's you access the application. And if you clear the cookies of you r browser you'll lose the access to your application.
That's it for today. Hope you've enjoyed this tutorial. Thanks for reading. 🙂
Preview may take a few seconds to load.
Below you will find some common used markdown syntax. For a deeper dive in Markdown check out this Cheat Sheet
Bold & Italic
Bold **double asterisks**
Three back ticks and then enter your code blocks here.
# This is a Heading 1
## This is a Heading 2
### This is a Heading 3
> type a greater than sign and start typing your quote.
You can add links by adding text inside of  and the link inside of (), like so:
To add a numbered list you can simply start with a number and a ., like so:
1. The first item in my list
For an unordered list, you can add a dash -, like so:
- The start of my list
You can add images by selecting the image icon, which will upload and add an image to the editor, or you can manually add the image by adding an exclamation !, followed by the alt text inside of , and the image URL inside of (), like so:
To add a divider you can add three dashes or three asterisks:
--- or ***