vicgutt/laravel-models-finder
A Laravel package that helps you find and discover Eloquent models in your application. It scans your project for model classes, making them easy to locate, list, and work with—handy for tooling, admin panels, and package development.
Architecture fit. laravel-models-finder is a small, single-purpose utility package that auto-registers a service provider and exposes a facade for enumerating classes extending Illuminate\Database\Eloquent\Model. It is application-level tooling, not a framework integration — no migrations, no config repository, no DB footprint. That makes it architecturally cheap to add but also means it delivers no capabilities we couldn't own outright. It fits cleanly only as a dev/CI-time helper (docs generation, admin scaffolding, test fixtures, static analysis), not as a runtime dependency.
Integration feasibility. High on paper: composer require vicgutt/laravel-models-finder, provider auto-discovery, one facade call. The real question is compatibility — the last release (2023-03-16) predates Laravel 11/12 and PHP 8.3/8.4. We must verify composer.json version constraints before assuming a clean install. If constraints are stale, we either pin an older Laravel or fork, both of which change the cost/benefit materially.
Technical risk. This is the dominant concern, and it is not technical complexity — it is supply-chain and lifecycle risk:
app/Models, and models in vendor packages are common edge cases; we need to confirm behavior for each.Key questions for the maintainer (or our spike):
app/Models?Stack fit. Fits any standard Composer/Laravel codebase. Because it has no runtime state, it can be scoped to require-dev and invoked from artisan commands, CI scripts, or code-gen tooling — which is where I'd keep it.
Migration path. Trivial and reversible — it's purely additive with no schema or data implications; composer remove fully reverses it. There is no "migration" in the data sense; the only migration is from the package to an in-house implementation if we adopt it and later want to drop it.
Compatibility. Two-tier plan: (a) dry-run install in a throwaway branch against our current Laravel/PHP matrix; (b) if constraints block us, evaluate a fork-and-relax (composer.json widen only) versus in-house. Given the tiny surface, in-house is often the cheaper path — model discovery via Finder + ReflectionClass/php-parser is ~50–80 lines and gives us control over edge cases.
Sequencing.
Maintenance. Effectively zero upstream maintenance — the package is dormant. If we adopt it, we own bug fixes and version bumps. This is the single strongest argument for in-house replication: we'd be maintaining it anyway, so we might as well own the code.
Support. No support channel, no SLA, no security advisory process. For a dev-only utility the blast radius is contained; for anything production-facing it would be disqualifying.
Scaling. Discovery scales linearly with file count and is fine at typical app sizes (hundreds of models). Without result caching, repeated scans in CI add seconds, not minutes. No horizontal-scaling concerns since it holds no state.
Failure modes. (1) Install fails on PHP/Laravel version drift; (2) class-loading side effects or fatals during scan; (3) silent under-discovery (missed models) producing incomplete generated output; (4) over-discovery (abstract classes, non-Eloquent bases) producing false entries; (5) quiet abandonment meaning the next Laravel major breaks it with no upstream fix. Mitigations: pin versions, cache results, add a fixture-based test asserting our expected model list, and vendor the source.
Ramp-up. Minutes for any Laravel-fluent engineer — the API is a facade method or two. The real ramp-up cost is the compatibility spike and the test-fixture work to trust the output, roughly one engineer-day end-to-end.
TPM recommendation. Do not take a durable dependency on this package in any production path. Its footprint is too small to justify the supply-chain (zero dependents, dormant maintainer) and compatibility risk at a score of 0. Either use it strictly as a require-dev convenience behind a spike that proves compatibility on our Laravel/PHP matrix, or — preferably — replicate the ~50–80 line discovery logic in-house and own it. The capability is genuinely useful (code-gen, docs, admin scaffolding); the package is not the right vehicle for it.
How can I help you explore Laravel packages today?