feat: add is_saved function
This commit is contained in:
@@ -54,4 +54,15 @@ public function getUrlAttribute()
|
||||
|
||||
return $this->external_url;
|
||||
}
|
||||
|
||||
|
||||
public function getIsSavedAttribute()
|
||||
{
|
||||
if (!auth()->check()) return false;
|
||||
|
||||
return $this->savedBy()
|
||||
->where('user_id', auth()->id())
|
||||
->exists();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user