Is there any possibility to turn on and turn off Laravel 5 maintenance without php artisan up and down commands when my website is being hosted ?
What I've done:
Route::get('site/shutdown', function(){ return Artisan::call('down'); }); Route::get('site/live', function(){ return Artisan::call('up'); });
The first route is working fine. But when I call site/live the site still is shuted down. What can cause this problem ?
and you can run laravel without artisan. If you rename server. php and copy . htaccess , it may make trigger some error when you try to run auth artisan command.
Artisan::call('down'); To bring the application remove the file or call the up command, as shown above.
To perform maintenance mode on Laravel, run the down Artisan command.
If your project is already down, you cannot call another function.
What happens after you run php artisan down
is that it creates a file named down
inside storage/framework
. After running php artisan up
the file is removed.
You can create the file manually inside storage/framework
. It will down your project. When you want to take your project live again, just remove the file.
I think the right answer is missing here.. You could add your route to app/http/middleware/CheckForMaintenanceMode.php
protected $except = [ //here ];
So It never would be off.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With