*/ use HasApiTokens, HasFactory, Notifiable; protected $fillable = [ 'first_name', 'last_name', 'email', 'phone', 'is_admin', 'password', ]; protected $appends = ['name']; /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return [ 'email_verified_at' => 'datetime', 'is_admin' => 'boolean', 'password' => 'hashed', ]; } public function picks(): HasMany { return $this->hasMany(Pick::class); } protected function name(): Attribute { return Attribute::make( get: fn (): string => trim($this->first_name.' '.$this->last_name), ); } public function canAccessPanel(Panel $panel): bool { return $panel->getId() === 'admin' && $this->is_admin; } }