*/ public static function boot() { parent::boot(); // static::created(function ($user) { // $user->preferensi()->create([ // 'data_topbar' => 'light' // ]); // }); } protected $guard_name = 'web'; use HasRoles; protected $fillable = [ 'name', 'email', 'password', ]; /** * The attributes that should be hidden for serialization. * * @var array */ 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 customer() { return $this->hasOne(Customer::class, 'user_id', 'id'); } public function theme() { return $this->hasOne(Theme::class, 'user_id', 'id')->withDefault(); } public function role() { return $this->belongsTo(Role::class); } public function driver() { return $this->hasOne(Driver::class); } }