mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 14:31:26 +00:00
Update Status model
This commit is contained in:
parent
cba743bb5b
commit
6d907414d1
1 changed files with 6 additions and 1 deletions
|
@ -103,8 +103,10 @@ class Status extends Model
|
|||
|
||||
public function liked() : bool
|
||||
{
|
||||
if(Auth::check() == false) {
|
||||
return false;
|
||||
}
|
||||
$profile = Auth::user()->profile;
|
||||
|
||||
return Like::whereProfileId($profile->id)->whereStatusId($this->id)->count();
|
||||
}
|
||||
|
||||
|
@ -130,6 +132,9 @@ class Status extends Model
|
|||
|
||||
public function shared() : bool
|
||||
{
|
||||
if(Auth::check() == false) {
|
||||
return false;
|
||||
}
|
||||
$profile = Auth::user()->profile;
|
||||
|
||||
return self::whereProfileId($profile->id)->whereReblogOfId($this->id)->count();
|
||||
|
|
Loading…
Reference in a new issue