drupol/composer-packages
Retrieve the list of packages installed by Composer in your project through a simple, object-oriented API, including names, versions, and metadata—no manual parsing of composer.lock or installed.json required.
Architecture fit
drupol/composer-packages is not a Laravel library — it is a Composer plugin that hooks Composer's own runtime and registers a packages command (plus a small PHP API) for enumerating installed packages by Composer "type" (library, composer-plugin, drupal-module, custom installer types, etc.) with table and JSON output.composer show --format=json and composer licenses --format=json.library artifacts (Drupal/WordPress/Magento/custom installer types) and needs a single inventory command.Package::all() inside a Laravel app, this is the wrong shape: it pulls Composer internals into the application's autoload graph.Integration feasibility
composer require --dev drupol/composer-packages, add an entry to config.allow-plugins (Composer 2.2+), then run composer packages.Technical risk
composer/composer in the autoload graph — a large, privileged dependency to avoid in production Laravel images.composer show; maintained SBOM plugins (CycloneDX) cover the audit angle. Unique value is narrow.Key questions
library package types, or is composer show --format=json sufficient?allow-plugins governance in place, and can approval be scoped to dev-only?Stack fit
require-dev, repository root, never in the application's require block, never in production images.PackagesCollection and related classes) inside Laravel service providers or Artisan commands. Read composer.lock or vendor/composer/installed.json directly instead — zero new dependencies.Migration path
composer packages and composer packages --format=json, and diff against composer show --format=json.composer inventory script.allow-plugins entry and a --no-plugins CI fallback.dev-master.Compatibility
allow-plugins: unapproved plugins hard-fail Composer 2.2+. Document approval in the repo and keep it out of global Composer config.Sequencing
composer show / composer licenses.Maintenance
allow-plugins entry becomes permanent repo configuration requiring review on each Composer upgrade.Support
composer script or Makefile target with a documented output contract.Scaling
installed.json, fine for hundreds of packages and for CI matrix fan-out.allow-plugins, the plugin loads on every Composer command in that repo, so one breakage stalls all installs and CI for the team.Failure modes
composer install, blocking builds and deploys. Highest severity; mitigate with dev-only install plus a --no-plugins fallback job.Ramp-up
allow-plugins touches every repo.composer show --format=json and a maintained SBOM plugin, and default to built-ins unless type-based filtering is a hard requirement.How can I help you explore Laravel packages today?