eloquent/pathogen
Eloquent Pathogen scans Laravel Eloquent models for common anti-patterns and hidden issues, flagging risky relationships, unsafe mass assignment, missing casts, and other unhealthy code so you can keep your models clean, predictable, and maintainable.
What the package is: eloquent/pathogen is a dependency-free, I/O-free value-object library for representing and manipulating filesystem paths in PHP. It provides Path, PathInterface, and a factory for building absolute/relative paths, joining segments, normalizing ../., and reading extensions, filenames, and parent directories. It performs no disk access — it is pure string transformation.
Architecture fit — moderate at best.
Illuminate\Filesystem\Filesystem, the Storage facade, SplFileInfo, and symfony/filesystem's Path (available transitively). A TPM must justify a second path abstraction in the same codebase.Integration feasibility — technically easy, strategically questionable.
composer require eloquent/pathogen + PSR-0 autoload; ~10–15 public methods to learn. Effort to adopt is measured in hours.Technical risk — high, concentrated in maintenance and runtime currency.
.. is not a sandbox. If paths derive from request input, this library must not be treated as a traversal defence; that control belongs at the storage/filesystem layer.Key questions for the team:
Storage, Filesystem, or symfony/filesystem Path does not already provide?Stack fit. The library is framework-agnostic and side-effect free, so it fits anywhere in a Laravel application — controllers, jobs, domain services — without bootstrapping. That is also its weakness: nothing in Laravel's container, config, or testing helpers is aware of it, so we get no framework affordances (no fakeable facade, no config-driven behaviour, no Octane lifecycle considerations to worry about either).
Compatibility.
Path-adjacent helpers, but also no guardrails against namespace confusion in developer code.Migration path (recommended: adapter-first, adopt-last).
str_replace, basename, explode(DIRECTORY_SEPARATOR, …)). This reveals the true scope of the problem.PathResolver/PathFactory interface owned by our codebase, with the concrete behaviour we actually need (join, normalize, extension, parent).symfony/filesystem Path or a ~100-line internal value object). This costs little and eliminates the archive risk entirely.Sequencing dependencies. The compatibility spike (step 0) must precede any commit to adopt, because the outcome — "works on PHP 8 as-is," "needs a fork," or "fatal, do not use" — determines whether the rest of the plan is even relevant. Parallel to that, the inventory should run because it is cheap and can shrink the problem before any code is written. Do not let a developer add use Eloquent\Pathogen\… directly into feature code ahead of the seam; that converts a reversible decision into a sprawling refactor.
Explicit recommendation. Do not adopt as a platform-level dependency. The opportunity score (0.53) and 75 stars are consistent with a library that is elegant but effectively dormant. Capability is reproducible in an afternoon; the maintenance liability is not.
Maintenance. Effectively zero upstream. Every future PHP upgrade, static-analysis tightening, or behavioural bug becomes our work. Compare that against alternatives already vendored through Laravel/Symfony, where that work is amortized across a large contributor base. This is the single largest operational cost and it is permanent.
Support. No maintainer to escalate to; no issue tracker with triage; documentation is a 2014-era README. Internal support burden falls on whoever adopts it — and knowledge of the Eloquent\* namespace family is rare on the team. Expect the "why does this exist?" question at every onboarding and every architecture review.
Scaling. A non-issue. Pure in-memory string manipulation, no I/O, no shared state, no caches, O(path length) per operation. It will never be a throughput or memory bottleneck, and it is trivially parallel-safe and safe under long-running workers (Octane, queue workers) because there is no mutable global state. Performance is not a reason to adopt or reject it.
Failure modes to plan for.
__toString implementations that can throw inside string contexts. Mitigation: convert at the seam boundary, never let the type escape into framework code.Storage/filesystem configuration, not to this library.Ramp-up. Low for the API (a handful of methods, intuitive names, no configuration), moderate for the surrounding judgement: engineers must learn when not to introduce a path object, and must unlearn the assumption that an unmaintained package is still receiving fixes. Realistically half a day to productivity, plus the ongoing tax of explaining the dependency's provenance in reviews.
Bottom line for the roadmap. Treat this as a reference design, not a dependency. Its value to us is as a well-shaped example of an immutable path value object; the code itself carries a permanent ownership cost with no offsetting benefit over what we already ship. If path handling is currently ad hoc and error-prone, the right investment is the internal seam described above — which is roughly the same effort as adopting Pathogen, without the archive risk.
How can I help you explore Laravel packages today?