forked from mirror/pixelfed
Update Status model
This commit is contained in:
parent
bed5cc74de
commit
f98c7caff6
1 changed files with 4 additions and 2 deletions
|
@ -150,8 +150,10 @@ class Status extends Model
|
||||||
if(Auth::check() == false) {
|
if(Auth::check() == false) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
return Cache::remember('status:'.$this->id.':likedby:userid:'.Auth::id(), now()->addHours(30), function() {
|
||||||
$profile = Auth::user()->profile;
|
$profile = Auth::user()->profile;
|
||||||
return Like::whereProfileId($profile->id)->whereStatusId($this->id)->count();
|
return Like::whereProfileId($profile->id)->whereStatusId($this->id)->count();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function likedBy()
|
public function likedBy()
|
||||||
|
|
Loading…
Reference in a new issue