*/ use HasFactory, Notifiable; /** * The attributes that are mass assignable. * * @var list */ protected $fillable = [ 'name', 'email', 'password', 'current_household_id', ]; /** * The attributes that should be hidden for serialization. * * @var list */ protected $hidden = [ 'password', 'remember_token', ]; /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return [ 'email_verified_at' => 'datetime', 'password' => 'hashed', ]; } public function households(): BelongsToMany { return $this->belongsToMany(Household::class, 'household_user') ->withPivot('role') ->withTimestamps(); } public function currentHousehold(): BelongsTo { return $this->belongsTo(Household::class, 'current_household_id'); } }