congnqnexlesoft / lumen-maintenance-mode by congnqnexlesoft

Define application maintenance mode.
54
0
1
Package Data
Maintainer Username: congnqnexlesoft
Maintainer Contact: congnqnexlesoft@gmail.com (Cong Nguyen Quang)
Package Create Date: 2024-05-14
Package Last Update: 2024-05-23
Language: PHP
License: MIT
Last Refreshed: 2024-06-13 03:00:07
Package Statistics
Total Downloads: 54
Monthly Downloads: 49
Daily Downloads: 0
Total Stars: 0
Total Watchers: 1
Total Forks: 0
Total Open Issues: 0

Lumen maintenance mode

  • Author: https://github.com/rdehnhardt/lumen-maintenance-mode
  • congnqnexlesoft clone and update for Lumen 6.x and PHP 7.4

How to install

  • PHP 7.4
export PATH=/usr/local/Cellar/php@7.4/$(ls /usr/local/Cellar/php@7.4 | head -1)/bin:$PATH
php -v | grep "PHP 7.4"
composer require congnqnexlesoft/lumen-maintenance-mode

How to configure

In bootstrap/app.php, add this instruction in providers

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

Response

Using JSON

  • Require config the line below to your .env file
## congnqnexlesoft/lumen-maintenance-mode ##
MAINTENANCE_RESPONSE_FORMAT=json

Using View

  • Copy these files to your project:
resources/views/errors/503.blade.php
storage/framework/.gitignore

Put the application into maintenance mode.

php artisan down

Bring the application out of maintenance mode.

php artisan up

IP released for access

In .env file

ALLOWED_IPS=999.99.9.999,999.99.9.999,999.99.9.999

DevOps

Release a new version

sh .ops/release-a-new-version.sh