<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;

class User extends Authenticatable
{
    use HasFactory, Notifiable;

    public $timestamps = false;

    protected $fillable = [
        'username', 
        'email', 
        'password', 
        'phone', 
        'balance', 
        'status', 
        'referral_code', 
        'referred_by', 
        'last_login',
        'two_factor_secret', 
        'two_factor_enabled' 
    ];

    protected $hidden = [
        'password',
        'remember_token',
        'two_factor_secret' 
    ];

    public function domains()
    {
        return $this->hasMany(UserDomain::class, 'user_id', 'id');
    }
}
