zpmlabs/laravel-package-quick-demo
zpmlabs/laravel-package-quick-demo is a compact Laravel package example for quickly understanding a minimal reusable package setup. It serves as a starter reference for package structure, service provider registration, and Composer integration in Laravel applications, ideal for developers prototypin...
Architecture fit. The package follows idiomatic Laravel extension points: a service provider, a facade (QuickDemo), DemoDefinition value objects, publishable assets/views/config, and three artisan commands (quick-demo:list, quick-demo:show, quick-demo:install). The isolation model is the strongest design decision — each demo gets its own SQLite file under database/quick-demos/, its own connection name (quick_demo_{key}), prefixed routes (/quick-demo/{key}, quick-demo.{key}.), namespaced views (quick-demo-{key}::), and segregated asset/storage/config destinations. This means demo data never touches the host application's default connection and the host's .env, config/database.php, and routes/web.php remain untouched — a defensible, low-blast-radius approach for a "try before you install" experience.
Integration feasibility. Integration is a bounded, well-specified change: add the dependency, create an examples/ subtree, and register a DemoDefinition in the target package's boot(). There is no middleware, no custom container bindings to reason about, and no modification of the host app's routing or DB config. The AGENTS.md contract is unusually explicit for an ecosystem package — hard rules, naming conventions, migration/seeder/model patterns, and a validation checklist — which lowers ambiguity but raises the compliance bar. Any deviation (generic table names, default-connection seeding, unprefixed routes) produces silent cross-contamination rather than an obvious error, so correctness depends on reviewers actually enforcing the checklist.
Technical risk. The dominant risk is maturity, not design. One star, zero dependents, a ^0.1 constraint, and an org-scoped namespace indicate pre-adoption status; the API surface (DemoDefinition named arguments, QuickDemoContext fields, hook signatures) can change without a major-version signal under 0.x semantics. Secondary risks: SQLite-only demos will misrepresent packages whose value depends on MySQL/Postgres features (JSON columns, full-text, strict FK behavior, specific collations), so the demo can be convincing but not representative. The public-asset publish step writes into public/vendor/quick-demos/{key}, and lifecycle hooks (afterInstall) execute arbitrary author-supplied code inside the consuming application — both need to be understood as trust boundaries. Finally, demos are mounted in a real Laravel app; if the install command is run on anything reachable, the demo routes are live unless the author gates them.
Key questions.
APP_ENV check), or is gating entirely the package author's responsibility?quick-demo:install fail atomically, or can it leave a half-installed demo (DB created, routes/views/assets missing)?quick-demo:uninstall? Or does --fresh just wipe the SQLite file?route:cache, config:cache, and Octane? Are routes and published config cache-safe?afterInstall hooks: any sandboxing, or fully trusted author code?Stack fit. The package targets exactly the audience for which it is designed: Laravel package authors who want a one-command demo. It slots in alongside composer.json requirements, service providers, Blade view namespaces, vendor:publish-style asset copying, and artisan — no new mental model for a Laravel team. Teams already shipping examples/ or README quick-starts get a structured, reproducible replacement for manual setup instructions.
Migration path. The transition is additive and reversible, which is its main selling point: existing manual demo instructions stay valid while the new path is proven in parallel. Recommended path: (1) add the dependency in a feature branch, (2) build a single examples/ demo for the least risky package (DB-only demo — stub plus one migration — per the documented minimal structure), (3) run the full validation checklist in a clean Laravel test app, (4) only then expand to routes/views/assets/storage/config demos, and (5) retire the old README quick-start once the command-based path is verified. Do not migrate multiple packages simultaneously; the conventions are copy-paste-prone and mistakes compound across packages.
Compatibility. Two axes to vet before committing: Laravel/PHP version coverage (must at least match the host package's own matrix, or the demo can't be installed where the package runs), and SQLite feature coverage versus what the package actually demonstrates. Where the package's core value is DB-engine-specific, either accept a reduced demo scope or keep the manual path as a fallback and treat quick-demo as best-effort. Verify that published config and route prefixes don't collide when several packages ship demos in the same app — the {key} convention should prevent it, but confirm with two demos installed side by side.
Sequencing. Dependency and naming decisions first (demo key, database name, table prefix — these are effectively permanent once published in docs and routes). Then the DemoDefinition registration and the DB/migration/seeder slice, validated end-to-end before any UI. UI (routes, controllers, views) next, then assets/storage/config, then hooks last and only if the standard surface genuinely can't express the demo. Add a CI job that runs quick-demo:install {key} --fresh --force against a throwaway Laravel app — that is the only way the contract stays enforced as the package evolves above you.
Maintenance. Ownership shifts to the consuming package: every demo adds migrations, seeders, models, views, assets, and config that are now part of the shipped package and must be maintained as the host package's schema and UI evolve. Because migrations bind to a generated connection name via QuickDemo::connectionName(), any change to demo-key or database-name conventions is a breaking change for every demo. Budget ongoing effort per demo, and expect to re-run the validation checklist on every quick-demo release until the dependency stabilizes past 0.x.
Support. Support load is front-loaded: the first failure users hit is almost always a convention violation (wrong table name, missing connection on a model, un-prefixed route), and those failures manifest as confusing empty pages or 500s rather than clear errors. Mitigate with quick-demo:show in troubleshooting docs and a short "if the demo is empty, check your connection name" note. Beyond convention errors, upstream support is thin — one star, no dependents, no track record — so assume you are the first responder and pin the version.
Scaling. For its intended use (developer onboarding, evaluation, sales demos) the model scales well: SQLite files are cheap and per-demo isolated, so N packages × M demos is a directory of small files with no shared-state contention. Limits appear elsewhere — published assets duplicate into public/vendor/quick-demos/ with no apparent garbage collection, installed demos accumulate in database/quick-demos/, and demo routes add to the route table permanently once installed. This is a developer-environment tool, not a production feature; state that explicitly in internal docs to prevent someone installing demos on a shared staging or production instance.
Failure modes. Most likely: partial install (DB created, assets/views absent), --force overwriting hand-edited demo files, route or view-namespace collisions from a reused demo key, connection name drift after an upgrade, demo routes exposed in a non-local environment, and demos silently diverging from the host package's real schema as migrations evolve. Also flag afterInstall hooks as code that runs with full application privileges — treat hook classes as first-class reviewed code, not config. Add a teardown check to the acceptance criteria since the docs emphasize install far more than removal.
Ramp-up. Low for anyone fluent in Laravel; the concepts (connection, namespace, prefixed routes) are standard. The real ramp is the convention surface: hard rules, naming schemes, migration/seeder/model patterns, and destination paths must all be learned before the first demo works, and the package is unforgiving of shortcuts. The AGENTS.md file is an asset here — it converts tribal knowledge into an agent- and reviewer-checkable spec, which meaningfully shortens onboarding and should be wired into code review as the acceptance checklist. Estimate roughly half a day for a Laravel-fluent engineer to ship their first validated DB-only demo, and one to two days for a full demo with routes, views, and assets. Recommend starting with one pilot package, measuring actual friction, and only then standardizing across the package portfolio.
How can I help you explore Laravel packages today?