*/ public function article(): BelongsTo { return $this->belongsTo(WebsiteArticle::class, 'article_id'); } /** * @return BelongsTo */ public function user(): BelongsTo { return $this->belongsTo(User::class); } public function canBeDeleted(): bool { return $this->user_id === Auth::id() || hasPermission('delete_article_comments'); } }