Local-First Package Manager for Laravel
Laralink automates the local package development workflow. Instead of manually editing composer.json and running git clone, Laralink handles it all with a single interactive command.
laravel-project/
├── app/
├── packages/ ← Managed by Laralink
│ └── vendor/
│ └── my-package/ ← Cloned source code
├── composer.json ← Auto-updated with path repositories
└── vendor/ ← Standard Composer vendor directory
composer require amjadiqbal/laralinkThe service provider is auto-discovered. No additional setup is needed.
Link a package for local development. Laralink will:
- Ask you to choose between installing from a Local Path or a Git Repository.
- Local Path mode: Provide the path to your local package. Laralink will verify the
composer.json, auto-detect the package name, copy files (excluding.git/andvendor/), and link it. - Git Repository mode: Provide the package name (or pass it as an argument). Laralink will prompt for a Git URL (defaulting to the GitHub URL) and clone it.
- Add a Composer
pathrepository to yourcomposer.json. - Run
composer require vendor/package:@devautomatically.
php artisan laralink:dev vendor/package
# or interactively:
php artisan laralink:devShow all packages with their status — Linked (local) vs Remote (Packagist).
php artisan laralink:listOutput example:
+---------------------+--------------------+---------+
| Package | Status | Version |
+---------------------+--------------------+---------+
| vendor/my-package | Linked (local) | @dev |
| laravel/framework | Remote (Packagist) | ^11.0 |
+---------------------+--------------------+---------+
Remove the local path repository and install the official version from Packagist. Optionally delete the local source code.
php artisan laralink:publish vendor/package
# or interactively (shows a list to choose from):
php artisan laralink:publish
# Also delete local source code:
php artisan laralink:publish vendor/package --delete# 1. Start local development
php artisan laralink:dev vendor/my-package
# → Clones to ./packages/vendor/my-package
# → Updates composer.json
# → Runs composer require vendor/my-package:@dev
# 2. Make changes in ./packages/vendor/my-package
# 3. See what's linked
php artisan laralink:list
# 4. When done, switch back to Packagist
php artisan laralink:publish vendor/my-packageYou can install a package directly from a local folder on your machine for testing and development.
-
Run the command:
php artisan laralink:dev
-
Select Local Path when prompted:
Install from: [0] Local Path [1] Git Repository -
Provide the absolute path to your package folder:
Enter the absolute path to your local package: > /home/user/projects/my-package -
The tool will automatically:
- Verify the
composer.jsonin the source directory. - Detect the package name (e.g.,
vendor/my-package) from the sourcecomposer.json. - Copy the files to the project's
./packagesdirectory (excluding.git/andvendor/folders). - Link it via a Composer path repository with the
symlinkoption enabled. - Run
composer requireto install the local package.
- Verify the
Note: The local path mode enables the Composer
symlinkoption by default, so changes made in./packagesare reflected immediately. If you later modify the path repository entry to disable symlinks, you will need to runcomposer updateto pick up changes from the original source.
MIT