Return to site
· Maintenance mode,Web Development,Web Applications,Laravel
broken image

When we do php artisan down in the command it just creates an empty file in app/storage/meta directory called ”down”.

You can call artisan from your application:

Artisan::call(‘up’);

If you don’t have access to server you can create the functionality. If the user is authenticated you can shut down using the route.

{

    Route::get('shut/the/application/down', function() 

    {

        touch(storage_path().'/meta/my.down');

    });

});

Then create another route to revert it as given below.

{

    @unlink(storage_path().'/meta/my.down');

});

Add a filter to check if its up

{

    if (file_exists($this['path.storage'].'/meta/my.down'))

    {

        return Redirect::to('site/is/down');

    }

});

The route to bring it back :

{

    @unlink(storage_path().'/meta/my.down');

});

The route to show the view when the site is down:

{

    return View::make('views.site.down');