andriymiz/laravel-staging-mode

Staging mode for Laravel project

v1.1.0 2024-07-21 22:45 UTC

This package is auto-updated.

Last update: 2024-10-21 23:20:48 UTC


README

Latest Version on Packagist Total Downloads

This package allows you to enable a "staging mode" for your Laravel application. This mode is similar to maintenance mode, but without blocking scheduled tasks and queues.

Installation

You can install the package via composer:

composer require andriymiz/laravel-staging-mode

You can publish the config file with:

php artisan vendor:publish --tag="staging-mode-config"

Add middleware in app/Http/Kernel.php:

protected $middleware = [
    // ...
    \StagingMode\Http\Middleware\PreventRequestsDuringStaging::class,
];

Usage

Run the following command to enable the staging mode:

php artisan staging:enable

This command will add the STAGING_MODE_SECRET environment variable to your .env file:

STAGING_MODE_SECRET=your-secret

Go to the /your-secret URL for allowing requests to your application.

License

The MIT License (MIT). Please see License File for more information.