*/ use HasFactory, Notifiable; /** * The attributes that are mass assignable. * * @var list */ protected $fillable = [ 'name', 'email', 'password', 'karma', ]; protected $hidden = [ 'password', 'remember_token', ]; protected function casts(): array { return [ 'email_verified_at' => 'datetime', 'password' => 'hashed', ]; } public function communities() { return $this->hasMany(Community::class, 'created_by'); } public function subscribedCommunities() { return $this->belongsToMany(Community::class)->withTimestamps(); } public function posts() { return $this->hasMany(Post::class); } public function comments() { return $this->hasMany(Comment::class); } public function votes() { return $this->hasMany(Vote::class); } }