j3rrey / lumen-5-maintenance-mode by J3rrey
forked from rdehnhardt/lumen-maintenance-mode

Define application maintenance mode.
170
3
1
Package Data
Maintainer Username: J3rrey
Maintainer Contact: J3rrey.git@gmail.com (Jeremy Bruns)
Package Create Date: 2019-06-07
Package Last Update: 2019-06-14
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-11-23 03:21:03
Package Statistics
Total Downloads: 170
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 3
Total Watchers: 1
Total Forks: 1
Total Open Issues: 0

Lumen 5 simple maintenance mode

Build Status

php 7.2 Lumen 5.8

How to install

composer require j3rrey/lumen-5-maintenance-mode

How to configure

Add this to your AppServiceProvider or in bootstrap/app.php

$app->register(
    j3rrey\MaintenanceMode\Providers\MaintenanceModeServiceProvider::class
);

Add the up and down commands in app/console/Kernel.php

    protected $commands = [
        \j3rrey\MaintenanceMode\Console\Commands\DownCommand::class,
        \j3rrey\MaintenanceMode\Console\Commands\UpCommand::class
    ];

Customize View

In case there is no 503 view file you will be asked if it should be created for you when putting your application in maintenance mode.

Example views at the bottom

resources/views/errors/503.blade.php

Put the application into maintenance mode.

php artisan down

Bring the application out of maintenance mode.

php artisan up

IP released for access

Currently only ipv4 and no iprange

Add ALLOWED_IPS in your .env file

ALLOWED_IPS=192.168.1.2,127.0.0.1,136.22.16.0

Example view

Laravel 503 blade file(2016): https://github.com/laravel/laravel/blob/696ab5149e6b6169f73b75321eaabf47a4a26645/resources/views/errors/503.blade.php