tomatophp/laravel-package-generator
A Laravel package generator that scaffolds new packages in seconds, creating service providers, config files, routes, migrations, and the full directory structure. It automates boilerplate so developers can focus on building reusable, publishable Laravel packages faster.
Architecture fit. This is a developer-workstation scaffolder, not a runtime library. It emits ordinary, first-party Laravel code — composer.json, a service provider, publishable config, migrations, routes, views, translations — and nothing it produces depends on the generator at runtime. That makes the architectural question unusually clean: the blast radius is a developer's local filesystem plus whatever gets committed. The generated package then lives in the standard Laravel extension shape (path-repository monorepo under packages/<vendor>/<name>, or a standalone repo), so it slots into a conventional Laravel architecture without imposing a new runtime pattern. The caveat is that the output is opinionated toward the TomatoPHP/Filament ecosystem; if we don't run that stack, the stubs must be pruned or forked before the output matches our architecture.
Integration feasibility. Mechanically trivial: composer require --dev into a scratch app (auto-discovery registers the Artisan command), or a global install to keep it out of any composer.lock. Pin an exact version — with one maintainer and zero dependents, upstream drift is our problem. The real integration work is post-generation: adding the repositories path entry and running composer update <vendor>/<name>, then wrapping the raw wizard in an internal make:package script that applies license headers, PHP/Laravel version floors, Pint/PHPStan/Rector configs, CI workflow, README/CHANGELOG templates, and .github/. That wrapper — not the vendor command — becomes the artifact onboarding docs reference.
Technical risk. Concentrated, and mostly organizational rather than technical:
src/Console/ and stubs/. Evaluation cost is reading code, not docs.--tag=config) collide across packages; view/translation namespace mismatches fail silently at render time, not at boot.Key questions for the maintainer/owner.
composer.json include a require-dev for orchestra/testbench or any test harness, and does it leak the generator itself into the dependency graph?make:package wrapper — platform or developer experience?Stack fit. Laravel-idiomatic by construction, with the caveat that it assumes a conventional Composer package layout and leans Filament. Fit is good if we standardize on path-repository monorepos and orchestra/testbench; poor if our monorepo layout isn't modellable or our tooling is non-idiomatic. Validation stack for the pilot should be composer validate --strict, Pint, PHPStan, and Pest/PHPUnit against a real CI runner — not just a local composer install.
Migration path. There is nothing to migrate. Adoption is reversible in a day because no generated artifact references the generator at runtime. If we decline, the output of two or three trial generations becomes the specification for our own template — a reusable artifact either way. If we adopt, the path is: fork the stubs → pin the fork as a VCS repository ({"type":"vcs","url":"[email protected]:your-org/laravel-package-generator.git"}) → wrap the command in make:package → make the wrapper the only sanctioned entry point.
Compatibility. Version pinning and Laravel-major drift are the two compatibility levers. Also verify PSR-4 namespace consistency between the service provider and composer.json, confirm loadMigrationsFrom/loadViewsFrom/loadTranslationsFrom are wired, and namespace publish tags per package (audit-log-config) so vendor:publish stays deterministic. Confirm behavior on Linux CI, not just on macOS workstations.
Sequencing.
src/Console/ and stubs/. Enumerate prompts and defaults..github/.chore: scaffold from generator vX.Y.Z) so reviewers see tool output versus human edits — this also builds the stub-fix backlog.composer install can still be wrong about tagging, changelogs, and CI on the second commit.Maintenance. If we fork — and we should — we own the stubs. Budget a few hours per Laravel major to refresh them, plus ad-hoc fixes when a generated package misbehaves. Abandonment of upstream degrades cleanly to "we maintain our fork," which is acceptable precisely because the output is ordinary Laravel code. Pin the exact generator version and the fork ref in the wrapper's lockfile.
Support. There is no vendor support, no SLA, no documentation, and a single maintainer's best-effort issue response. That means the support surface is internal and must be owned by a named team — platform or developer experience — before rollout. When a scaffolded package misbehaves, the complaint lands on the tool owner, not on the upstream repo. Debugging is by reading source and stubs, which should be written into the internal runbook.
Scaling. Technically it scales fine: it never runs in production, so there is no load, availability, or latency dimension. The scaling risk is organizational. Value accrues as (hours saved per package) × (packages per quarter); cost accrues as package sprawl plus convention drift across squads. Mitigate with one sanctioned stub set, one wrapper script, and a lightweight conformance check in package CI. This should be budgeted as internal developer-productivity spend — never a roadmap line item and never in customer-facing or platform-strategy narratives.
Failure modes. Mostly silent and mostly cheap, but each needs a checklist item:
Class not found immediately after generation → missing path-repository entry or missing composer update <vendor>/<name>, not a generator bug.vendor:publish → colliding publish tags across packages.loadViewsFrom alias inconsistent with view('alias::...') call sites.Ramp-up. Low for engineers: an interactive wizard, a handful of prompts, and a wrapper script. The real ramp-up is on the owning team — reading the source, forking the stubs, and writing the internal runbook. Do not publish onboarding guidance until the pilot package ships a release; measure success as time-to-first-package for new hires and the number of packages created without hand-edited boilerplate. Against the alternative of spatie/package-skeleton-laravel plus an internal template repo, the honest framing is: this is a one-to-two-engineer-day spike to decide whether we fork it, not a procurement or platform-strategy decision.
How can I help you explore Laravel packages today?