Add Article::uri accessor for the absolute post URL

Follow the uri/link convention already used by Note, Bookmark, and
Place, rather than concatenating config('app.url') inline where the
absolute URL is needed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017USyUg8PwuoDcHP8pv5xjy
This commit is contained in:
Jonny Barnes 2026-09-13 12:12:36 +01:00
commit 4aa93d63bb
Signed by: jonny
SSH key fingerprint: SHA256:CTuSlns5U7qlD9jqHvtnVmfYV3Zwl2Z7WnJ4/dqOaL8
3 changed files with 19 additions and 1 deletions

View file

@ -93,6 +93,13 @@ class Article extends Model
);
}
protected function uri(): Attribute
{
return Attribute::get(
get: fn () => config('app.url').$this->link,
);
}
/**
* Scope a query to only include articles from a particular year/month.
*/