Activate Mode Maintenance Laravel 5.1 Without Artisan

1

I know there is the php artisan down command to enable maintenance mode, but I have my application hosted and I do not know how to give this command. Would you have some other way to do that? Editing a file?

    
asked by anonymous 04.02.2016 / 20:48

1 answer

3

Yes it is possible without a terminal, but first I will talk about php artisan down , it is not because you have moved a project to the server that the artisan command will work. Generally we only move the project or we do all the installation inside the server and even the project of a client will be in a repository so we work on the basis of composer update .

Basically you will have to install composer and laravel (and artisian) on the production server and download your client project by git (or another similar method) and access will probably be all SSH .

But this is ample to explain. Without delays, I'll explain how to do this without using terminal , you can create two routes (preferably with authentication) and use Artisan::call :

Route::get('/admin/down', function()
{
    return Artisan::call('down');
});

Route::get('/admin/up', function()
{
    return Artisan::call('up');
});

When calling something like http://site/admin/down it will go into maintenance mode and if you use http://site/admin/up it will return to normal.

04.02.2016 / 21:09