Testing a Composer package against a real Laravel app is slower than it should be. You do not just run the tests: you first rewire the app so it uses your working copy.
The manual way
- Add a path repository to the app's composer.json.- Require the package as @dev.- Run composer update and test.- Undo the repository entry and restore the version constraint before you commit.Step 4 is the one people forget, and it is how a path repository ends up in a real project. Composer documents path repositories in its repositories reference [1]. ## The one-command way Laralink is a Laravel dev tool that does the whole round trip. Install it as a dev dependency: composer require amjadiqbal/laralink --dev It adds three artisan commands: laralink:dev, laralink:list and laralink:publish.
- Checks first. It compares the package's PHP and Laravel constraints with your app, using Composer's semver rules, before it touches anything.- Links your working copy. The package is linked into ./packages, so vendor/ points at the code you are editing.- Cleans up after itself. If the install fails, composer.json is restored and the link or clone is removed. Removing a symlinked package only removes the symlink.- Puts the constraint back. laralink:publish restores your exact previous constraint, for example ^2.3 in require-dev.## Requirements PHP 8.3+, Laravel 12 or 13, Composer 2 and Git. MIT licensed. ## Links Documentation and demo: https://urlshortly.com/TKDSi Source code: https://urlshortly.com/yLUuB ## References [1] Composer documentation, Repositories, Path: https://getcomposer.org/doc/05-repositories.md#path How do you test packages in a real app today? Tell me in the comments.
![Physical AI Engineering — Ch.10: Medical and Human Centric Physical AI [EN]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvy8fkq2vnw6ud8c0kvic.png)
![Physical AI Engineering — Ch.09: Industrial Physical AI [EN]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2ulspenbbtgxps8mti74.png)
![Physical AI Engineering — Ch.08: Autonomous Vehicles and Mobility [EN]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fudcokq8k14p8ppu1mdnf.png)
![Physical AI Engineering — Ch.06: Control and Actuation [EN]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgqtcsihzvvie5v9x4dzo.png)
![Physical AI Engineering — Ch.05: Decision Making and Reasoning [EN]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fanmj7rqd1d7j07dzk4yv.png)