calhoun/eloquent-otf
Eloquent OTF lets Laravel developers define Eloquent relationships on the fly, adding hasOne, hasMany, belongsTo, and similar relations without editing model classes. Useful for packages, dynamic dashboards, and flexible apps. It keeps models clean while enabling runtime relationship configuration.
Architecture fit. calhoun/eloquent-otf is a niche Laravel package that appears to extend Eloquent with "on-the-fly" behavior — most plausibly dynamic relationship or model resolution at runtime rather than via statically declared classes. That places it squarely in the persistence layer of a Laravel app, which is the highest-blast-radius part of the stack. As a TPM, the relevant fit question is not "does it work" but "does it replace idiomatic Eloquent in a way my team can reason about at 2 a.m." Runtime/magic resolution trades explicit code for convenience, which typically raises cognitive load, weakens static analysis (Larastan/PHPStan), and complicates debugging. It fits well only if the team already accepts dynamic-model patterns and has strong test coverage around the domain using it.
Integration feasibility. Composer-installable, MIT-licensed, Laravel-style package structure (service provider + trait is the expected shape). Integration effort is likely low-to-moderate: composer require, publish config if present, apply trait to target models. The real feasibility blocker is provenance, not mechanics — 72 stars and zero dependents means there is no observable production footprint in the ecosystem. Treat it as unproven until verified.
Technical risk.
Key questions to resolve before commitment.
@phpstan-ignore?Stack fit. Only viable for Laravel/PHP stacks (PHP 8.x presumed, Laravel 9–11 to be confirmed). It is not a framework-agnostic library. If the codebase is Laravel-first and the team is comfortable with Eloquent internals, the conceptual fit is reasonable; if the org is migrating toward more explicit/typed persistence (e.g., DTOs, repositories, read models), this package pushes in the opposite direction and should be rejected on architectural grounds.
Migration path. Do not retrofit existing models. Instead:
Compatibility. Verify Composer constraints against the app's locked Laravel/PHP versions before any code is written. Check transitive dependencies for conflicts. Confirm behavior under the app's test matrix (SQLite/MySQL/Postgres) since runtime resolution can diverge by driver. Confirm Octane/Swoole compatibility if applicable.
Sequencing.
If any of the key questions come back unsatisfactory (no tests, stale releases, unclear semantics), the correct TPM call is reject and implement the 50–100 lines natively — the convenience gain is unlikely to justify the ownership burden.
Maintenance. This is the dominant cost. With one maintainer, 72 stars, and zero dependents, the realistic assumption is that your team becomes the de facto maintainer the moment it lands in production. Budget for forking, patching, and eventually owning the code. MIT license makes forking legally trivial but doesn't reduce the engineering cost.
Support. No community to lean on. No Stack Overflow corpus, no downstream bug reports to crib from. Internal documentation and a named owner are prerequisites, not nice-to-haves.
Scaling. Runtime resolution overhead is per-model-instantiation; at high request volume or in queue workers this can compound. Benchmark under realistic load before rollout. Octane compatibility must be proven, not assumed — static caches in dynamic-model packages are a classic source of cross-request contamination.
Failure modes.
Ramp-up. New engineers will not have seen this pattern. Onboarding cost is real and recurring: expect each new hire to need a walkthrough, and expect code review to require a reviewer who understands the package's semantics. If the team is small or has high turnover, this is a material drag.
TPM recommendation. Score 0.45 with zero dependents is a conditional-no by default. Proceed only if (a) the source audit shows a genuine, tested capability that would cost more than ~2 engineer-days to replicate natively, (b) the scope is one bounded context behind a flag, and (c) a named internal owner accepts maintenance. Otherwise, replicate natively and keep the persistence layer boring.
How can I help you explore Laravel packages today?