Menu

Test a Composer package in a real Laravel app with one command
📰

Test a Composer package in a real Laravel app with one command

DEV Community: laravel·Amjad Iqbal·11 days ago
#tISEfyXd
#devtolaravel#devto#dev#path#composer
Long article (255 words) — no AI summary yet.
Reading 0:00
15s threshold

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.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.