laranail/demo-mode

Comprehensive, granular, license-aware demo/sandbox controller for Laravel products — read-only & write guards, per-model/route/feature gating, reset/restore strategies, per-visitor sandboxing, demo accounts and banner. Complements laranail/license-verifier without re-implementing it. CLI/TUI-first.

Maintainers

Package info

github.com/laranail/demo-mode

Homepage

Documentation

pkg:composer/laranail/demo-mode

Transparency log

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-07-06 22:27 UTC

This package is auto-updated.

Last update: 2026-07-09 00:09:56 UTC


README

Latest version on Packagist Tests Static analysis License: MIT

A granular, license-aware demo / sandbox controller for Laravel products — block writes, gate features, reset data periodically, isolate visitors, auto-login, and show a banner, all configurable with sensible defaults.

Requires PHP ^8.4 || ^8.5 on Laravel ^13. Complements laranail/license-verifier (a trial app can drop into demo mode automatically) but works standalone with no hard dependency.

Install

composer require laranail/demo-mode
php artisan vendor:publish --tag="demo-mode-config"

The service provider and the Demo facade are auto-discovered.

Quick start

Turn demo mode on (or drive it from the license):

DEMO_MODE_ENABLED=true        # manual toggle
# DEMO_MODE_TRIGGER=license   # or: demo when the license is not usable

Block writes on your routes and models, and gate a feature:

Route::middleware('demo.readonly')->group(/* writes blocked in demo */);
Route::post('export', ...)->middleware('demo.feature:export');
use Simtabi\Laranail\Demo\Mode\Concerns\PreventsDemoWrites;

class Setting extends Model
{
    use PreventsDemoWrites; // all writes blocked in demo
}
@demo <span class="badge">Demo</span> @enddemo

See Getting started for every surface — facade, middleware, controllers, models, Blade, and events.

What it controls

Concern Mechanism Docs
Activation manual / license / both / environment / schedule triggers, plus bypass by role/ability/id/IP/gate Configuration · License integration
Write protection layered: HTTP middleware + Eloquent guard + strict/read-only connection Write guards
Feature gating named features, entitlement-aware (paying customers keep full functionality) Getting started
Reset & restore pluggable strategies (migrate-fresh-seed, snapshot, SQL dump, callback), scheduled or on demand Reset & restore
Visitor isolation shared / transactional / scoped / tenant sandboxes Per-visitor sandbox
Demo UX & safety banner, demo accounts / auto-login, side effects to safe sinks (mail → log) Configuration · Security

Documentation

Full documentation is at opensource.simtabi.com/documentation/laranail/demo-mode — getting started, activation triggers, write protection, per-model/route/feature gating, reset strategies, per-visitor sandboxing, middleware, the Artisan commands, and configuration.

Guides

Reference

Stability

Semver. The package is on the 0.x line — minor versions may contain breaking changes until 1.0; pin to a patch range and read the CHANGELOG and UPGRADE guide before upgrading.

Local development

composer install
composer test    # pest
composer lint    # pint + phpstan + rector --dry-run

Sister packages

The laranail licensing family:

Package What it is
laranail/license-kit Server-side licensing — activation keys, polymorphic assignment, expirations/renewals, seat control.
laranail/license-verifier Headless, provider-agnostic verification client — PASETO/Ed25519 offline verification, fingerprinting, seats, grace periods.
laranail/license-verifier-ui UI engine for the verifier — scaffolds owned, themeable preset packages (Blade, Livewire, Filament, Vue).
laranail/product-updater License-gated self-update engine — checks a source, verifies archives, applies releases safely.

Community

Questions, bug reports, and ideas go to GitHub Issues.

Contributing & security

Issues and PRs are welcome — see CONTRIBUTING.md. Report vulnerabilities per SECURITY.md (opensource@simtabi.com); participation follows the Code of Conduct.

License

MIT © Simtabi LLC. See LICENSE.