Use uri for the like and bookmark permalinks
`uri` is the attribute every other postable model uses for its absolute permalink on this site. Add it to Like, which had none, and rename Bookmark's `local_uri` to match. `url` stays as the thing being liked or bookmarked. Refs #148 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
7ce256baa5
commit
5481956d78
1 changed files with 18 additions and 3 deletions
|
|
@ -18,6 +18,13 @@ class Like extends Model
|
|||
use FilterHtml;
|
||||
use HasFactory;
|
||||
|
||||
protected function uri(): Attribute
|
||||
{
|
||||
return Attribute::get(
|
||||
get: fn () => config('app.url').'/likes/'.$this->id,
|
||||
);
|
||||
}
|
||||
|
||||
protected function url(): Attribute
|
||||
{
|
||||
return Attribute::set(
|
||||
|
|
|
|||
Loading…
Reference in a new issue