LaravelEric L. Barnes4 min readintermediate
Laravel Vet: Review Composer Code Before It Installs
Summary
Laravel Vet is a Composer plugin that intercepts installs/updates, shows the diff of each package, and lets you approve changes manually or via an LLM‑based coding agent. Trusted packages are recorded in a `vet.json` with a content hash, so future updates only prompt for new changes. The tool exits with an error on untrusted code, making it CI‑friendly, and works with any PHP project using Compos…
- Installs as a dev dependency (`composer require laravel/vet --dev`) and requires PHP 8.4+.
- Run `./vendor/bin/vet --init` to seed `vet.json` with hashes of the current vendor tree.
- During `composer update`, Vet pauses before writing files and prints a diff per package; you can approve with the space bar or hand off to an LLM (Claude, Gemini, etc.) that returns PASS/FAIL/WARN.
- `vet.json` stores version + a Merkle‑style hash of every file; any change—even without a new version—forces a re‑review.
Supply‑chain attacks in the PHP ecosystem are rising; Vet gives teams a low‑friction way to audit new code before it lands, leveraging existing LLM agents for quick triage while keeping a deterministic trust record.
5/10




