🎉 Enjoying this package? Consider sponsoring me on GitHub or buying me a beer.
Introduction
A powerful Laravel package that places your application into read-only mode with advanced features for maintenance, security, and access control.
Features
- Simple Configuration: Enable/disable with a single
.envflag - IP Whitelist/Blacklist: Control access by IP address with CIDR support
- Role-Based Exceptions: Allow specific user roles to bypass lockout
- Custom Responses: View, JSON, or custom response types
- API Support: Automatic API detection with JSON responses
- Route Patterns: Whitelist routes by pattern or name
- Health Check Endpoint: Built-in monitoring endpoint
- Cache Integration: Performance optimization with configurable caching
- Event System: Listen to lockout events for logging and monitoring
- Artisan Commands: Manage lockout via command line
- Blade Directives: Conditional rendering based on lockout status
Quick Start
- Install the package:
1composer require rappasoft/lockout
- Enable lockout:
1# In .env2APP_READ_ONLY=true
- That's it! Your application is now in read-only mode.
Use Cases
- Maintenance Mode: Put your application in maintenance while keeping it accessible
- Emergency Lockdown: Quickly disable write operations during security incidents
- Scheduled Maintenance: Allow read access while performing updates
- Demo Environments: Prevent data modification in demo/staging environments
- Access Control: Combine with IP whitelisting for secure maintenance access
Requirements
- PHP 8.2+
- Laravel 11.x or 12.x
