morningtrain/php-loader
A lightweight PHP loader for Morningtrain projects that simplifies autoloading and class resolution. It offers a simple, framework-friendly API to register loaders, resolve namespaces, and keep bootstrapping clean. Ideal for Laravel apps needing flexible, explicit loading without extra overhead.
require a PHP file and optionally instantiate a class from it — that is usually 30–80 lines of in-house code. The decision it informs is less "should we adopt this" and more "do we even need a dependency for this, or is it a half-day of internal code?"require/new logic instead of scattering it.Adopt or vendor it when:
nwidart/laravel-modules, or a proper DI container).Look elsewhere (or build in-house) when:
require_once handle the overwhelming majority of "load a file, get a class" cases. If your files are known at build time, this package adds nothing.To executives: This is a very small open-source utility (MIT-licensed) for loading PHP files and instantiating classes dynamically. It is not a platform investment — it has negligible adoption (1 GitHub star, no downstream dependents), so we should treat it as a code reference, not a dependency. Recommendation: if we pursue a plugin/module capability, we copy the pattern into our own codebase (a few hours of engineering) and keep full ownership. Cost is trivial; the real decision is whether the plugin/module feature is on the roadmap at all.
To engineering: The package does one thing — require a file and optionally new a class — with no autoloading integration, dependency injection, versioning, or isolation. Given that Laravel and Composer already solve the common cases, the only defensible use is a dynamic plugin/module loader where file paths are not known at build time. Even then, vendor it: the upstream has no maintenance signal and no dependents, so we'd be adopting unreviewed code. Estimate: under a day to implement and test internally, with our own error handling, path validation, and caching — which we'd need to add anyway.
How can I help you explore Laravel packages today?