lendable/composer-license-checker
A dev tool that checks Composer dependency licenses against configurable rules to ensure open source compliance and reduce legal risk. Define allowed licenses, vendors, and packages in a PHP config file, then run it in CI. Uses installed.json or composer licenses as its data source.
Architecture fit
vendor/bin/composer-license-checker), not a Laravel service provider bundle. For a Laravel/PHP codebase this is actually a good fit: it lives entirely in require-dev, has no runtime coupling to the framework, and imposes no bootstrapping, middleware, or container registration cost..allowed-licenses.php) rather than declarative YAML/JSON. That is idiomatic for a PHP shop and allows computed rules (e.g., reading a vendor allow-list from an env var), but it means config is code and must be reviewed as code — no schema validation beyond what the builder enforces.composer why before adoption, since the tool cannot audit itself if it is excluded from the lock file scan.Integration feasibility
composer require --dev, one config file, one CI step. No application code changes, no migrations, no framework wiring.installed.json (default) lets the check run in a minimal CI image with no Composer binary; licenses provider shells out to Composer and is described by the maintainers as the more stable API. This dual-path is a meaningful resilience feature but also a decision the team must standardize on, otherwise results diverge between local and CI runs.--format enables ingestion into existing dashboards/alerting, but treat the JSON shape as unstable — no documented schema contract.Technical risk
installed.json, and the README itself flags potential schema drift. This is an undocumented, unsupported contract with Composer — a Composer minor release is a plausible breakage vector.(MIT or GPL-2.0) style expressions, path/VCS repositories) are where false positives will surface and where a legal-compliance gate will lose credibility fastest.addAllowedPackage, teams will disable the step.Key questions
installed.json (fast, schema-fragile) or composer licenses (needs Composer runtime, stable API)?Stack fit
composer.lock/installed.json rather than application code.Migration path
addAllowedVendor for first-party and addAllowedPackage for known exceptions. Each exemption gets an owner and a review date.Compatibility
1.3.x for PHP 8.2/8.3 shops, 1.4.x for 8.4+) and record the pin rationale in the repo. Renovate/Dependabot must be configured to open, not auto-merge, PHP-minor-bump releases of this package.installed.json requires composer install to have run; the licenses provider requires the Composer binary on PATH.--no-dev installs, since dev-only installs change what installed.json contains.Sequencing
Maintenance
Support
installed.json parsing failures after Composer upgrades. Keep a documented fallback: switch --provider-id=licenses and re-run.Scaling
composer.json location — plan the CI matrix accordingly rather than assuming a single invocation covers everything.Failure modes
installed.json — Composer update breaks parsing; job fails or, worse, silently reports incomplete results. Mitigation: pin the licenses provider in CI, or run both and diff.--format json mode and explicitly track "unknown license" packages as a distinct, visible class rather than silently passing.addAllowedPackage broadly to unblock themselves, hollowing out the policy. Mitigation: require a linked ticket and expiry on exemptions; audit exemption list growth monthly.licenses provider's dependency on a Composer binary in the build image is an implicit requirement that breaks when images change.Ramp-up
How can I help you explore Laravel packages today?