'bool', 'is_system' => 'boolean', 'must_change_pw'=>'bool', 'quota_mb'=>'int', 'last_login_at'=>'datetime', ]; public function domain(): BelongsTo { return $this->belongsTo(Domain::class); } public function setPasswordAttribute(string $plain): void { // optional: allow 'password' virtual attribute $this->attributes['password_hash'] = password_hash($plain, PASSWORD_BCRYPT); } // Scopes public function scopeActive($q) { return $q->where('is_active', true); } public function scopeSystem($q) { return $q->where('is_system', true); } public function scopeByEmail($q, string $email) { return $q->where('email', $email); } }