<?php

namespace App\Models;

use App\Modules\UserAdjustments\Traits\UserAdjustments;
use Filament\Models\Contracts\FilamentUser;
use Filament\Panel;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Illuminate\Support\Facades\Date;

/**
 * @property int $id
 * @property string $name
 * @property null|string $email [unique]
 * @property Date|null $email_verified_at
 * @property string $password [hidden]
 * @property string|null $remember_token
 * @property Date|null $created_at
 * @property Date|null $updated_at
 */
class User extends Authenticatable implements FilamentUser
{
    /** @use HasFactory<\Database\Factories\UserFactory> */
    use HasFactory;

    use Notifiable;
    use UserAdjustments;

    /**
     * The attributes that are mass assignable.
     *
     * @var list<string>
     */
    protected $fillable = [
        'name',
        'email',
        'password',
    ];

    /**
     * The attributes that should be hidden for serialization.
     *
     * @var list<string>
     */
    protected $hidden = [
        'password',
        'remember_token',
    ];

    /**
     * Can access panel
     */
    public function canAccessPanel(Panel $panel): bool
    {
        return true;
    }
}
