feat: add is_saved function

This commit is contained in:
2025-11-29 11:17:45 +03:30
parent 6f60a2627d
commit c9d442223c
2 changed files with 35 additions and 6 deletions
+11
View File
@@ -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();
}
}