'datetime', 'password' => 'hashed', ]; public function posts(): HasMany { return $this->hasMany(Post::class, 'author_id'); } public function comments(): HasMany { return $this->hasMany(Comment::class, 'author_id'); } public function isAdmin(): bool { return $this->role === 'admin'; } public function isAuthor(): bool { return $this->role === 'author'; } }