dominikb/composer-license-checker
A Composer plugin that checks your project's dependency licenses against configurable allow and deny lists, helping you spot incompatible or risky packages early and keep releases compliant.
Architecture fit. dominikb/composer-license-checker is a Composer-level tool, not a Laravel package in the framework sense. It operates on the dependency graph resolved in composer.lock, which means it sits alongside the build rather than inside the application. For a Laravel/PHP estate this is a good fit: it requires no service container bindings, no middleware, no config publish step, and adds zero runtime footprint when installed with --dev. It is stack-agnostic across Composer projects, so the same tooling and policy can cover Laravel applications, internal packages, and standalone PHP libraries without a second vendor relationship.
Integration feasibility. Low effort. Install as a require-dev dependency, define an allow/deny policy for licenses, and invoke it as a Composer script or CI step. The work is measured in hours, not sprints. The real effort is not engineering — it is the legal/policy decision about which licenses are acceptable, and that is a stakeholder dependency, not a technical one.
Technical risk.
composer.json files. Packages that omit a license field, declare non-SPDX strings, or dual-license will produce ambiguous results. The tool's normalization behavior must be verified before enforcement, not assumed.allow-plugins configuration; if disabled in a CI image, the check can pass without ever running. That is a false sense of compliance and the single most dangerous failure mode here.Key questions.
require from require-dev, and can policy differ between them?Stack fit. Compatible with PHP 7.4+/8.x and Composer 2.x projects, including Laravel 8 through current. Install with composer require --dev dominikb/composer-license-checker, keep it out of production images, and wire it into the existing CI workflow alongside PHPUnit and static analysis. Ensure allow-plugins is explicitly permitted for this plugin in composer.json so CI does not silently skip it.
Migration path. Do not start in enforcement mode. Phase it:
Compatibility. The tool tracks the Composer plugin API, so a Composer major upgrade is the primary compatibility event to watch. Pin to a specific minor version, review the changelog on upgrade, and validate against the CI base image's Composer and PHP versions. There is no application-code compatibility surface.
Sequencing. Pilot on one repo → portfolio-wide baseline inventory → policy sign-off with legal → advisory CI gate → blocking gate on main → extend output into SBOM and release sign-off artifacts → establish a recurring review cadence tied to dependency upgrade cycles. The engineering sequence is short; the policy sequence is the critical path. Run them in parallel from week one.
Maintenance. Minimal ongoing engineering: a version bump alongside routine Composer updates. The genuine maintenance burden is policy upkeep — the approved-license list needs an owner and a review cadence, otherwise it calcifies and teams start requesting blanket exceptions.
Support. Assign ownership to platform engineering or developer experience, with legal as the policy authority and engineering as the operator. Publish a short runbook covering: what to do when a build fails on a license, how to request an exception, and how exceptions are recorded and time-boxed. Without this, the gate generates support tickets rather than compliance.
Scaling. Excellent. The scan is lockfile-based and fast, adding seconds to CI. Scale comes from distribution, not compute: publish the policy as a shared, reusable CI workflow or a shared config package so dozens of repositories inherit one definition. Centralizing policy is what makes the tool a governance control rather than a per-team checkbox.
Failure modes.
Ramp-up. Roughly half a day for a competent PHP engineer to pilot and wire into CI. The organizational ramp-up is longer: legal review of the baseline inventory, exception handling design, and developer communication. Budget one to two weeks end-to-end for a first team, then near-zero marginal cost per additional repository once the shared workflow exists.
How can I help you explore Laravel packages today?