From 6d907414d14a8a4732bf7c53dfa9604ae4d8d493 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 8 Nov 2018 18:28:07 -0700 Subject: [PATCH] Update Status model --- app/Status.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Status.php b/app/Status.php index 9208bf8b4..bbe5e5932 100644 --- a/app/Status.php +++ b/app/Status.php @@ -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();