Search by

devguard / devguard-laravel

arsarsars1

DevGuard Anti-Theft, Domain Allowlisting, and Milestone Autolock Middleware for Laravel

Package info

github.com/DevGuard-uk/devguard-laravel

pkg:composer/devguard/devguard-laravel

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.1 2026-11-22 16:00 UTC

This package is auto-updated.

Last update: 2026-11-22 16:00:42 UTC


README

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 DevGuardServiceProvider and devguard middleware 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 Unavailable with Retry-After: 3600 so Google and search engines never de-index your site during temporary disputes.
  • Artisan Commands: Includes php artisan devguard:status and php 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
# Prefer project SDK key (Portal → Project SDK key). Falls back to DEVGUARD_API_KEY.
DEVGUARD_SDK_KEY=your_project_sdk_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