Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Composer Include Files Laravel Package

0.0.0/composer-include-files

A Composer plugin that includes PHP files via configurable glob patterns and explicit load order, without relying on autoload files. Useful for helper functions, bootstrap scripts, and legacy code that must load early in the request.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. composer-include-files is not a Laravel package in the conventional sense — it is a Composer plugin that hooks the post-autoload-dump event and injects an extra include step ahead of Composer's generated vendor/composer/autoload_files.php. Its only legitimate use case is narrow and infrastructural: you have a file that must execute before any autoloaded file from any dependency (constants, runtime polyfills, function-shim definitions, environment guards). In a standard Laravel application this need is almost always already met by bootstrap/app.php, a service provider register() method, or a files autoload entry whose ordering you control by declaring the owning package as an early dependency. Reaching for a Composer plugin to solve load ordering is a signal that the ordering requirement has not been designed, only patched.

Integration feasibility. Mechanically easy: add the dependency, permit it in config.allow-plugins (mandatory since Composer 2.2), and declare the files. The friction is not installation but governance — enabling a Composer plugin grants it execution during install/update on every developer machine and in CI, with the same privileges as the build user. That is a meaningful trust boundary to open for a package with 12 stars and zero dependents.

Technical risk. High relative to the value delivered. Three concerns compound: (1) the plugin API surface of Composer 2.x is stable but not frozen, and a single-maintainer package with no dependents has no downstream pressure to be fixed when it breaks; (2) the plugin mutates generated artifacts under vendor/, which means composer dump-autoload --no-plugins, a CI image that strips plugins, or an alternate install path can silently regress load ordering with no error — a class of failure that surfaces as a fatal "undefined function" in production rather than in tests; (3) bus factor of one, no ecosystem, effectively unmaintained by any reasonable operational definition.

Key questions. What file genuinely must load before all Composer autoload files, and can that requirement be removed by restructuring (e.g., moving the constant/function into a PHP 8.1+ prepend autoloader or a bootstrap file required by public/index.php)? Is the ordering requirement load-bearing for correctness or only for convenience? Who owns the upgrade path if the plugin is abandoned? Is there a composer.lock-pinned, reproducible install in CI that would catch a regeneration regression? Has the plugin's source been reviewed given it executes at build time?

Integration Approach

Stack fit. Framework-agnostic; works with any Composer project, Laravel included. It sits below Laravel's bootstrap — it changes what exists in the process before the framework starts, which means Laravel's own conventions (service providers, bootstrap/app.php, package discovery) offer no leverage over it. Teams should treat it as infrastructure, not application code, and keep it out of the application namespace entirely.

Migration path. Adoption is a single line in require plus the allow-plugins entry. The harder direction is removal: once application or package code depends on a constant or function being defined by an early-included file, deleting the plugin converts a silent ordering guarantee into a production fatal error. Any adoption should be paired with a written invariant — "file X must define Y before Z loads" — plus a test that asserts the behavior independent of the plugin, so the dependency can be removed later.

Compatibility. Verify before anything else: Composer plugin-api constraint (should be ^2.x), PHP version floor versus the application's floor, and behavior under --no-plugins and --no-dev. The --no-dev case matters because a plugin installed in require-dev will not run in a production composer install --no-dev, which is exactly where the load-order guarantee is needed. This must be a production dependency if it is used at all.

Sequencing. (1) Prove the requirement is real with a failing test on the current stack. (2) Attempt two cheaper alternatives — a prepend autoloader or an explicit require at the top of the front controller — before considering the plugin. (3) Only if both fail, adopt with a lockfile pin, an allow-plugins entry scoped to the exact package name, CI verification that dump-autoload output contains the include, and a removal ticket with the invariant documented.

Operational Impact

Maintenance. Effectively zero upstream maintenance expectation; plan to vendor or fork it. The code surface is small enough that forking is realistic, which is the only thing that makes this tolerable — but a fork is now internal infrastructure someone must own.

Support. No community, no issue traffic, no Stack Overflow corpus. Any incident debugs from source. Support cost is low-frequency but high-severity when it triggers, because failures manifest as boot-time fatals across every request rather than as degraded behavior.

Scaling. Does not scale organizationally: the knowledge that "load order depends on a plugin" lives with whoever added it. It is invisible in code review, absent from onboarding docs unless deliberately recorded, and surprising to every new engineer. Multiply by team size and by environment count (local, CI, staging, prod, container builds) where plugin execution may differ.

Failure modes. Ordered by likelihood: silent regeneration without the plugin (--no-plugins, stripped CI, alternate builder) yielding correct-looking builds and runtime fatals; Composer major upgrade breaking the event hook; plugin abandoned and blocking a Composer upgrade; a second early-include requirement creating an ordering conflict the plugin cannot express; supply-chain exposure from a build-time executable with a single maintainer and near-zero community scrutiny.

Ramp-up. Low to install, high to safely remove. Budget the removal design at adoption time — the invariant test and the documented "why" are not optional. For a package at this adoption level (12 stars, 0 dependents, low opportunity score), the default TPM recommendation is to solve the underlying ordering requirement in application bootstrap and decline the dependency, unless a concrete failing test demonstrates the alternatives cannot work.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator