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.
.allowed-licenses.php file makes "no unapproved licenses ship" an enforceable acceptance criterion on every PR rather than a periodic legal audit. This is a roadmap enabler for any release gate or "production readiness" checklist you already own.addAllowedVendor() and addAllowedPackage() are explicit escape hatches. That is good product design — it forces exceptions to be visible and reviewable in code review rather than hidden in tribal knowledge. Treat each entry as a decision record with an owner.--allow-file), internal packages with an allow-list of vendors, and pre-release checks for distribution-style products.installed.json default — no Composer binary needed, but it parses a Composer-internal schema that can change; composer licenses — more stable API, needs Composer present), it supports --format json for dashboards/ticketing, and it handles disjunctive licensing and packages with no declared license (both of which are where naive grep-based scripts break). Note the runtime constraint: v1.4.x requires PHP 8.4+ (it dropped 8.2); v1.2.x covers PHP 8.2/8.3. Verify parity with your app's PHP version before committing.Adopt when:
--format json).Look elsewhere when:
installed.json provider's reliance on a Composer-internal schema, and you also cannot guarantee the composer binary in the CI image. One of the two providers must be viable for you.For executives — the one-paragraph version: This is a small, free, MIT-licensed developer tool that adds an automated license-compliance gate to our PHP build pipeline. It reads the licenses of every Composer dependency we install, compares them against a policy file we control, and fails the build if anything unapproved appears. The cost is roughly an afternoon of setup and one CI step; the return is a continuously verified answer to "what open-source license obligations are we carrying?" — the question that shows up in enterprise security questionnaires, customer contracts, M&A diligence, and any decision to open-source or redistribute our code. It reduces the risk of discovering a copyleft (GPL/AGPL) dependency after it has shipped, when remediation is expensive and legal review is urgent. It is dev-only: nothing is added to production, no data leaves our CI, and no vendor contract is required. Adoption risk is low because the tool is small and MIT-licensed — if the upstream project stalls, we can fork it.
For engineering — the pitch:
composer require --dev lendable/composer-license-checker. No runtime footprint..allowed-licenses.php, declaring permitted licenses (MIT, BSD-2/3-Clause, Apache-2.0, ...), plus addAllowedVendor() for our own org and addAllowedPackage() for justified exemptions. The config is code — it goes through review, so exceptions are explicit and attributable../vendor/bin/composer-license-checker. Non-zero exit fails the build. Wire it next to the static analysis and test jobs.--provider-id=json (default) to avoid needing the Composer binary in the check container; switch to --provider-id=licenses if the installed.json schema drifts.--format json if we want to feed results into a dashboard or auto-open a ticket.What to be honest about internally: This is a policy-enforcement mechanic, not a compliance program. It does not scan for vulnerabilities, does not produce an SBOM, and does not generate attribution notices. It has a small community footprint, so we own the upgrade path. Set expectations accordingly: it answers "are we violating our stated license policy?" — not "are we legally safe?" That second question is a legal-review process, and this tool's job is to make sure legal only ever sees genuine exceptions instead of a spreadsheet.
How can I help you explore Laravel packages today?