devguard-laravel maintained by devguard
Description
DevGuard Anti-Theft, Domain Allowlisting, and Milestone Autolock Middleware for Laravel
Author
Last update
2026/11/19 12:01
(dev-main)
License
Downloads
1
DevGuard Laravel Guard
Official Laravel package for DevGuard anti-theft protection, domain allowlisting, invoice milestone autolock enforcement, and SEO-safe HTTP 503 lockouts.
Features
- Auto-Discovery: Automatically registers
DevGuardServiceProvideranddevguardmiddleware alias. - Fail-Safe Open Policy: Network timeouts, DNS issues, or unreachable APIs will never bring down your production application.
- Milestone Autolock: Automatically syncs due-dates and delinquency states with your DevGuard dashboard.
- Domain Authorization: Enforces authorized hosting domains with support for wildcard subdomains (
*.example.com). - SEO Preservation: Returns
503 Service UnavailablewithRetry-After: 3600so Google and search engines never de-index your site during temporary disputes. - Artisan Commands: Includes
php artisan devguard:statusandphp artisan devguard:lock.
Installation
Install via Composer:
composer require devguard/devguard-laravel
Publish the configuration file (optional):
php artisan vendor:publish --tag="devguard-config"
Configuration
Add the following environment variables to your .env file:
DEVGUARD_ENABLED=true
DEVGUARD_PROJECT_ID=your_project_id_here
DEVGUARD_API_URL=https://api.devguard.uk
DEVGUARD_API_KEY=your_optional_api_key
DEVGUARD_ALLOWED_DOMAINS=example.com,*.example.com
DEVGUARD_FAIL_SAFE=open
DEVGUARD_CACHE_TTL=300
Middleware Usage
Laravel 11 (bootstrap/app.php):
->withMiddleware(function (Middleware $middleware) {
$middleware->append(\DevGuard\Laravel\Http\Middleware\DevGuardMiddleware::class);
})
Laravel 9 & 10 (app/Http/Kernel.php):
Add to your global or web middleware stack:
protected $middlewareGroups = [
'web' => [
// ...
\DevGuard\Laravel\Http\Middleware\DevGuardMiddleware::class,
],
];
Or apply to specific route groups:
Route::middleware(['devguard'])->group(function () {
Route::get('/', [HomeController::class, 'index']);
});
Artisan Commands
Check Project & Lock Status
php artisan devguard:status
Emergency Local Lock
php artisan devguard:lock --toggle
php artisan devguard:lock --unlock