I'm having following error :ENUM

After defining the 'status' attribute in the 'AppointmentResource' and using 'App\Enums\AppointmentStatus,' I have added 'protected $casts = ['status' => AppointmentStatus::class]' in the model. However, I am encountering an error that says, 'Class "App\Enums\AppointmentStatus" not found.' I'm currently stuck at this point.
Solution
it should look like this
<?php

namespace App\Enums;

use Filament\Support\Contracts\HasColor;
use Filament\Support\Contracts\HasLabel;

enum AppointmentStatus: string implements HasLabel, HasColor
{
    case Created = 'created';
    case Confirmed = 'confirmed';
    case Canceled = 'canceled';

    public function getLabel(): ?string
    {
        return match($this) {
            self::Created => 'Created',
            self::Confirmed => 'Confirmed',
            self::Canceled => 'Canceled',
        };
    }

    public function getColor(): string | array | null
    {
        return match ($this) {
            self::Created => 'warning',
            self::Confirmed => 'success',
            self::Canceled => 'danger',
        };
    }
}
Was this page helpful?