Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laralink Laravel Package

amjadiqbal/laralink

Laralink is a Laravel package for creating and managing links inside your application. It offers a simple API for generating short or internal URLs, storing link records, and handling redirects, making link management easy to integrate into existing Laravel projects.

View on GitHub
Deep Wiki
Context7

Getting Started

v2.0.0 is effectively the first release you can act on. 1.x was never on Packagist, and its tagged commands didn't implement the options its README described. Treat any 1.x tutorial, gist, or the old README as fiction — specifically --symlink, a laralink-config publish tag, and a config/laralink.php.

  1. Check the floor before you start. PHP 8.3+ and Laravel 12 or 13. This is a hard install constraint, not a soft warning, and there is no ^1 to fall back to.
  2. Install as a dev dependency: composer require --dev amjadiqbal/laralink.
  3. Confirm it registered: php artisan about — look for the Laralink block showing the installed version and support link. If it's absent, the service provider isn't discovered; check bootstrap/providers.php and clear config.
  4. Look here first, in this order:
    • php artisan list laralink — the real surface area, not the README's.
    • php artisan laralink:list — baseline on an app with nothing linked.
    • ./packages/.laralink.json — created after your first link; this file, not your memory, is the source of truth for how each package is linked and what constraint it had before.
  5. First use case — live-edit a package: php artisan laralink:dev --source=../billing. You now have a path repository (added first) plus a symlink into vendor/. Edit the source folder, refresh, no publish cycle. If you don't pass --source, interactive mode offers packages found in ../*, ../*/*, and ~/projects.

Implementation Patterns

Inner loop (folder link). laralink:dev --source=../acme/billing → edit → refresh. Leave it linked for the whole feature. laralink:list --filter=local tells you what's currently wired to your disk.

Review a branch or tag without a release. laralink:dev [email protected]:acme/billing.git --branch=feature/retries. Any Git URL form works: https://, git@host:, ssh://, file://. This is the highest-value pattern — smoke test a PR against your actual app instead of a scratch project.

Copy instead of symlink when the package cares about its own path. --copy for anything that resolves __DIR__, hardcodes paths, or does its own composer install. It also behaves more predictably in Docker/CI where bind mounts make symlink targets confusing. Dot folders (.git, .github) are preserved.

Keep dev tooling out of production. laralink:dev preserves require-dev if the package was there. So test helpers and generators stay dev-only through the link/publish cycle without you touching composer.json by hand.

Promote to a real dependency. laralink:publish acme/billing --backup. It restores the constraint the package had before linking, or requires the latest release if there wasn't one — no more "always latest." The backup lands in ./packages/.backups/ with Git history included, so it's a real escape hatch, not a tarball.

Use --json for guards. php artisan laralink:list --json for a pre-push or CI step that fails when anything is still linked. Filters are only local|remote; the interesting signal is the status field (linked, local files not linked, linked but not required, remote) — use that to detect drift rather than the filter.

Cleanup. laralink:publish --delete on a symlinked package removes only the symlink; the source folder is never touched. A clone with uncommitted changes won't be deleted without --backup or --force.

Re-pointing. Swapping ../billing-old for ../billing-new needs --force; it runs composer reinstall so vendor/ follows the new target.

Version-check escape hatch. --skip-version-check when the package's own composer.json declares a Laravel/PHP constraint your app technically misses but you know works. Good for evaluating a package before its author bumps the constraint.

Repository ordering is a feature. The path repository is added first, so it wins over Packagist and any other repo. Handy for testing a fork that shadows a public package name.

Gotchas and Tips

  • --symlink is removed. Symlinking is the default for folders; --copy opts out. Any script or muscle memory using --symlink will fail.
  • There is no config file and never was. Don't chase a laralink-config tag or config/laralink.php. Per-package state lives in ./packages/.laralink.json; everything else is flags.
  • Version check reads the package's composer.json with Composer semver rules. A stale illuminate/support constraint in the dependency blocks the link even when the code is fine. Fix the package, or pass --skip-version-check knowingly.
  • Failure semantics differ between the two commands, and it matters. If Composer fails, laralink:dev restores composer.json and removes the link/clone it made — you're clean. laralink:publish restores composer.json but leaves the package linked — you're safe but unfinished; re-run, don't assume it succeeded.
  • --delete --force on a clone is destructive. Without --backup or --force it refuses when there are uncommitted changes. Check git status in the clone before forcing; there is no undo once it's gone.
  • Namespace casing changed. 1.x declared Amjadiqbal\Laralink while Composer autoloads AmjadIqbal\Laralink. If you forked, extended, or string-matched those class names, re-verify — class_exists and instanceof are case-sensitive on Linux and CI will catch you if your laptop doesn't.
  • Path repo wins over everything. While acme/billing is linked you cannot validate the released version in the same app. Run laralink:list before tagging your own release, or you'll ship against local code.
  • Don't run composer install inside a symlinked package unless you intend to mutate the source repo's vendor/. Use --copy if you need an isolated install.
  • .laralink.json and ./packages/.backups/ are app-local. Keep the state file out of git; treat the backups folder as something you back up deliberately, since it's your recovery path after a --delete.
  • Debugging ladder: php artisan about (version) → laralink:list --json (state + lockfile version) → cat packages/.laralink.json (remembered constraint) → composer config repositories (ordering) → composer why acme/billing.
  • --source accepts absolute paths, ~/, and file://, so you can point at a mounted volume, a build artifact directory, or a sibling checkout outside the project tree — useful when the package lives in a monorepo that isn't adjacent to the app.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core