nadar/php-composer-reader
A small PHP library for reading and manipulating composer.json files. Check readability and writability, retrieve metadata like description, and iterate over sections such as require and autoload to inspect packages, version constraints, and PSR mappings.
composer.json policy checks, package inventory reports, and migration scripts. Section readers for require, require-dev, autoload, and autoload-dev make it easier to expose dependency data in Artisan commands or admin dashboards.composer.json migrations.composer.json manipulation and parsing Composer CLI output. PM-relevant use cases include synthetic test fixtures, dependency snapshots, and CI checks without hand-rolled JSON handling.composer.json from PHP or Laravel: reading dependency sections, inspecting autoload mappings, checking writability, adding/removing entries, or saving changes.spatie/laravel-package-tools or similar is a better fit. Also avoid this package if you only need CLI commands and no PHP-level manipulation.runCommand() requires a globally installed Composer binary, and array input should be validated against the Composer schema before being trusted.To executives: This is a low-cost, MIT-licensed utility that can reduce custom development effort for internal dependency-management and developer-automation tools. It is not a strategic platform bet, so we should pilot it in internal workflows—dependency audits, package scaffolding, CI checks—where failure is contained and the alternative is building JSON manipulation ourselves.
To engineering: The package gives us a small API for reading and manipulating composer.json, including section readers for dependencies and autoload definitions, add/remove/save operations, and Composer command execution. Recent releases add PHP 8.3/8.4 support plus array input and command output methods, which are useful for test fixtures, in-memory transformations, and Artisan-based tooling. Recommended adoption pattern: use it behind our own service/command boundary, validate schema inputs, pin the version, and avoid it in customer-critical paths until we prove maintenance and behavior. Good first pilots are a composer.json audit command, a package-scaffolding helper, or a CI dependency snapshot tool.
How can I help you explore Laravel packages today?