goldnead/statamic-smartlinks
Statamic addon for smart internal links: reference entries, pages, or URLs with simple syntax and let the addon resolve them into valid links automatically, so content stays intact even when slugs or site structure change.
config/smartlinks.php. The key you care about in v0.2.1 is routes.segments, which maps each collection to a URL segment. The default layout is songs at /hoeren/song/{slug} and releases at /hoeren/release/{slug}.landingUrl() and clickUrl() (or the package's Blade tags) rather than hand-building route() calls — that is the whole point of the v0.2.1 fix, since each entry now resolves its own route.php artisan smartlinks:resolve once to populate platform links, and inspect the resulting statuses (dead, suspect, unknown) in the DB/CP before wiring up any scheduled job.landingUrl() for the public page and clickUrl() for the outbound redirect target. Treat these as the only supported way to get an entry's URL; the CP build and tags use the same path, so hand-built strings are the first thing to break on upgrade.routes.segments instead of relying on flat /{slug} routes. This is now the supported way to have a song and a release with the same slug.smartlinks:resolve for the routine sweep (it now counts every stored platform as present, dead or not, so it won't append a duplicate link next to a hidden dead one). Schedule a second, less frequent run with --replace-dead to actually repair dead rows.--replace-dead writes the newly found link into the dead link's row and preserves the other columns, so downstream code reading platform_id / entry_id doesn't change — only the URL and check history do.--replace-dead drops the check history.config/smartlinks.php isn't mistaken for a no-op refactor./hoeren/song/{slug} and /hoeren/release/{slug} against a fixture that deliberately collides the same slug across both collections — that is the exact regression v0.2.1 exists to prevent./hoeren/{slug} for releases, that is a silent 404 for existing traffic. Add 301 redirects from the old path before deploying, and grep your Blade/JS for hardcoded release URLs.--replace-dead is conservative by design. Only platforms whose links are all confirmed dead are re-resolved. suspect and unknown links are never touched — if a link is stuck in suspect, re-running the command will not help; you need to resolve its status first.--replace-dead run.routes.segments, (b) the collection order in config, and (c) whether the entry is hidden/dead, in that order. Most "wrong page" reports are config order, not code.landingUrl() / clickUrl() and the tags are the seam to override if you need signed or UTM-tagged outbound links — do it there rather than in a route macro, so the CP build stays consistent with the front end.How can I help you explore Laravel packages today?