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 Exclude Files Laravel Package

mcaskill/composer-exclude-files

Composer plugin that lets you exclude specific files from autoloading. Declare exclusions in composer.json to keep classmaps lean and stop unwanted files autoload entries from loading—handy for test fixtures, stubs, and optional integrations. Simple configuration, no code changes required.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. This is a Composer plugin, not a Laravel package with a service provider. It belongs in the dependency-resolution and build layer, not in application runtime architecture. It is a reasonable fit when the specific problem is unwanted autoload.files entries emitted by a dependency: for example, duplicate global helper functions, legacy bootstrap files, or files that conflict with application bootstrapping. It is not a substitute for removing/replacing a package, fixing PSR-4 autoloading, or controlling Laravel package discovery. Treat it as a narrow, build-time compatibility shim.

Integration feasibility. Technically feasible for a Laravel/PHP codebase: add the Composer plugin, allow it in config.allow-plugins, configure the exclusions, regenerate the autoloader, and verify the resulting vendor/composer output. The main integration nuance is deployment: if production runs composer install --no-dev, a plugin placed only in require-dev will not be present to generate the production autoloader. The team must decide whether the plugin is a production dependency, installed globally in the build image, or applied only in a build artifact pipeline. Composer plugin approval and supply-chain review are mandatory.

Technical risk. Risk is medium-high because the package alters Composer-generated autoload artifacts. Excluding a file can remove global functions, constants, or side effects that another dependency implicitly relies on, producing runtime failures that are difficult to trace. Composer internals and generated file formats can change across versions, and optimized/authoritative autoload modes may expose differences. The package also has low adoption signals — roughly 40 stars and zero dependents — so it should be pinned and treated as a controlled build dependency rather than an assumed standard. MIT licensing is favorable and permits an internal fork if needed.

Key questions. What exact configuration format and matching rules does the plugin use for exclusions? Does it modify autoload_files.php, the static $files representation used by Composer 2, or both? Is behavior stable across composer install, composer update, and composer dump-autoload -o? How does it behave under --no-dev and --classmap-authoritative? Does it fail loudly when a configured exclusion no longer matches? Can exclusions be scoped per package or path? Does it conflict with other Composer plugins that rewrite autoload output? What Composer and PHP versions are supported? Is there an active maintainer and a clear upgrade path?

Integration Approach

Stack fit. Fit is best for Laravel applications or libraries on Composer 2.x where a specific third-party package declares an autoload.files entry that must not load. It should not be used to exclude polyfills, framework bootstraps, or package files unless platform requirements are fully understood. If the real goal is to eliminate a dependency, use Composer replace, package removal, or a maintained fork instead. This plugin is for surgical autoload-file exclusion, not dependency removal.

Migration path. Start by baselining the application test suite and production-like boot path. Inspect vendor/composer/autoload_files.php, installed package metadata, and Composer output to identify the exact file and owning package. Create a branch, add the plugin at a pinned version, explicitly allow the plugin in composer.json, and configure the minimum exclusion set. Run composer dump-autoload -o, diff the generated autoload artifacts, and execute Laravel tests plus console, queue, and HTTP smoke tests. Promote through staging before production.

Compatibility. Validate against the project’s Composer version, PHP version, and Laravel version. Test both development and production install paths, especially composer install --no-dev, optimized autoloading, and CI cache behavior. Confirm the plugin handles Composer 2’s generated autoload structure, not just a legacy autoload_files.php array. Check for interaction with existing Composer plugins and deployment scripts. Lock the plugin version and record the allow-plugins entry so CI and production builds behave identically.

Sequencing. First, confirm the package solves an observed problem rather than a suspected one. Second, run a time-boxed spike that proves the exclusion survives autoload regeneration. Third, add automated checks that assert the excluded file is absent and the application still boots. Fourth, update CI and deployment images so the plugin is available wherever the production autoloader is generated. Fifth, document rollback: remove the exclusion, remove the plugin, regenerate autoload, and redeploy. Finally, monitor dependency updates that may change file paths or reintroduce the conflict.

Operational Impact

Maintenance. Ongoing code maintenance is low, but lifecycle maintenance is not zero. The team must own the plugin version, Composer compatibility, allow-plugins policy, and exclusion rationale. With low ecosystem adoption and no dependents, the package should have an internal owner and a fallback plan: fork under MIT, replace the dependency, or remove the exclusion. Re-test on Composer upgrades and major Laravel upgrades.

Support. Support burden is moderate because failures can look unrelated to the plugin. An excluded helper file may cause “undefined function” or “undefined constant” errors, or subtle boot-order differences. Create a runbook that lists each excluded file, the owning package, the reason, the affected environments, and the rollback command. Ensure developers know to check the plugin configuration before debugging missing global functions.

Scaling. Runtime scaling impact is negligible because the plugin operates at build/install time and may reduce a small number of bootstrap includes. It does not reduce installed package footprint or dependency risk. In monorepos or multi-app repositories, centralize configuration and test each application’s autoload output independently. Large exclusion lists increase cognitive load and should be treated as technical debt with periodic review.

Failure modes. Common failure modes include the plugin being blocked by allow-plugins, the plugin missing from production builds, Composer regenerating autoload files without the exclusion, dependency updates changing file paths so exclusions silently stop matching, an excluded file being required by another package, conflicts with other Composer plugins, and differences under optimized or authoritative autoload modes. Each should have a detection check and a documented rollback.

Ramp-up. A Composer-fluent engineer can validate the package in roughly half a day to two days, including a staging test and generated-artifact inspection. Team-wide ramp-up is mainly awareness: most developers should not need to touch it, but senior engineers and release owners must understand the allow-plugins setting, deployment implications, and failure symptoms. Budget additional time for security review and CI verification.

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.
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib