Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Maintenance Bundle Laravel Package

carteni/maintenance-bundle

Symfony bundle to put your site into maintenance mode while allowing access for a whitelist of IP addresses. Configure via YAML or XML, optionally route to a custom controller, and override the maintenance Twig templates to match your app.

View on GitHub
Deep Wiki
Context7

Show your site in maintenance mode. Allow to see the site under maintenance to a list of given IPs.

SensioLabsInsight

Installation

  1. Download the Bundle.
$ composer require carteni/maintenance-bundle
  1. Enable the Bundle in AppKernel.
public function registerBundles()
    {
        $bundles = [
            new \Mes\Misc\MaintenanceBundle\MesMaintenanceBundle(),
        ];
    }
  1. Configure the Bundle.
mes_maintenance:
    enabled: true
    ips_allowed: [10.10.10.0, 10.10.10.1, 10.10.10.2]
    controller: your_custom_controller:controllerAction or leave blank: controller ~.

If you prefer xml:

<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:mes-maintenance="http://multimediaexperiencestudio.it/schema/dic/maintenance"
           xsi:schemaLocation="http://multimediaexperiencestudio.it/schema/dic/maintenance
           http://multimediaexperiencestudio.it/schema/dic/maintenance/maintenance-1.0.xsd">

    <mes-maintenance:config enabled="true">
        <mes-maintenance:ip_allowed>10.10.10.0</mes-maintenance:ip_allowed>
        <mes-maintenance:ip_allowed>10.10.10.1</mes-maintenance:ip_allowed>
        <mes-maintenance:ip_allowed>10.10.10.2</mes-maintenance:ip_allowed>
    </mes-maintenance:config>

</container>

The maintenance template can be overridden in app/Resources/MesMaintenanceBundle/views/index.html.twig

# app/Resources/MesMaintenanceBundle/views/index.html.twig
{% extends '::base.html.twig' %}

{% block body %}
    <h1>Custom Template</h1>
    {% include '@MesMaintenance/maintenance.html.twig' %}
{% endblock %}

You can also override the maintenance.html.twig template in app/Resources/MesMaintenanceBundle/views/maintenance.html.twig

Unit tests and check code style

$ make
$ make test
$ make cs

License

This bundle is under the MIT license. See the complete license in the bundle

Reporting an issue

Issues are tracked in the Github issue tracker.

Enjoy!

♥ ☕ m|e|s
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast