X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/ecab2c8e42ae11485bb3c0fcce1a51df1bc6b118..refs/pull/4467/head:/app/Activity/Models/Comment.php diff --git a/app/Activity/Models/Comment.php b/app/Activity/Models/Comment.php index 72098a3c3..bcbed6c56 100644 --- a/app/Activity/Models/Comment.php +++ b/app/Activity/Models/Comment.php @@ -5,6 +5,7 @@ namespace BookStack\Activity\Models; use BookStack\App\Model; use BookStack\Users\Models\HasCreatorAndUpdater; use Illuminate\Database\Eloquent\Factories\HasFactory; +use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\MorphTo; /** @@ -35,7 +36,7 @@ class Comment extends Model implements Loggable /** * Get the parent comment this is in reply to (if existing). */ - public function parent() + public function parent(): BelongsTo { return $this->belongsTo(Comment::class); } @@ -50,20 +51,16 @@ class Comment extends Model implements Loggable /** * Get created date as a relative diff. - * - * @return mixed */ - public function getCreatedAttribute() + public function getCreatedAttribute(): string { return $this->created_at->diffForHumans(); } /** * Get updated date as a relative diff. - * - * @return mixed */ - public function getUpdatedAttribute() + public function getUpdatedAttribute(): string { return $this->updated_at->diffForHumans(); }