Adding method for disapproving a comment

This commit is contained in:
Nicholas Francis
2019-02-13 15:50:16 +05:30
committed by GitHub
parent 7bbc024302
commit e8b5b7a237
+10 -1
View File
@@ -43,6 +43,15 @@ class Comment extends Model
return $this; return $this;
} }
public function disapprove()
{
$this->update([
'is_approved' => false,
]);
return $this;
}
protected function getAuthModelName() protected function getAuthModelName()
{ {
@@ -57,4 +66,4 @@ class Comment extends Model
throw new Exception('Could not determine the commentator model name.'); throw new Exception('Could not determine the commentator model name.');
} }
} }