enum only showing the path

i want to call AppointmentTime but for some reason i get the path inside bot the label can anyone tell me what i did wrong
No description
No description
No description
No description
28 Replies
Dennis Koch
Dennis Koch7mo ago
What you did is pass one option with the name of your class. You should use ->enum()
Ahmadmhk
AhmadmhkOP7mo ago
now it give me nothing inside
No description
No description
Vp
Vp7mo ago
can you try ->options(AppointmentTime::class)
Dennis Koch
Dennis Koch7mo ago
Oh yeah. It's options. Sorry. I think ->enum() is a leftover from v2
Ahmadmhk
AhmadmhkOP7mo ago
No description
Ahmadmhk
AhmadmhkOP7mo ago
and of i do it like this
->options([AppointmentTime::class])
->options([AppointmentTime::class])
Ahmadmhk
AhmadmhkOP7mo ago
No description
Ahmadmhk
AhmadmhkOP7mo ago
<?php

namespace App\Enums;

use Filament\Support\Contracts\HasLabel;

enum AppointmentTime: string implements HasLabel {
case TIME_9 = '09:00';
case TIME_10 = '10:00';
case TIME_11 = '11:00';
case TIME_12 = '12:00';
case TIME_13 = '13:00';

public function getLabel(): ?string
{

return match ($this) {
self::TIME_9 => '9:00',
self::TIME_10 => '10:00',
self::TIME_11 => '11:00',
self::TIME_12 => '12:00',
self::TIME_13 => '13:00',
};
}

}
<?php

namespace App\Enums;

use Filament\Support\Contracts\HasLabel;

enum AppointmentTime: string implements HasLabel {
case TIME_9 = '09:00';
case TIME_10 = '10:00';
case TIME_11 = '11:00';
case TIME_12 = '12:00';
case TIME_13 = '13:00';

public function getLabel(): ?string
{

return match ($this) {
self::TIME_9 => '9:00',
self::TIME_10 => '10:00',
self::TIME_11 => '11:00',
self::TIME_12 => '12:00',
self::TIME_13 => '13:00',
};
}

}
Dennis Koch
Dennis Koch7mo ago
What version are you using?
Ahmadmhk
AhmadmhkOP7mo ago
v3
Ahmadmhk
AhmadmhkOP7mo ago
this one is working
No description
Vp
Vp7mo ago
weird, I used it like this only and never run a problem..
Ahmadmhk
AhmadmhkOP7mo ago
i dont know one is working and the other one is not working
Dennis Koch
Dennis Koch7mo ago
Wait? Isnt't this the exact one you just sent the error for?!
Ahmadmhk
AhmadmhkOP7mo ago
this one is status
Dennis Koch
Dennis Koch7mo ago
It's a different Enum
Ahmadmhk
AhmadmhkOP7mo ago
same
Dennis Koch
Dennis Koch7mo ago
What's the difference between those two? 😅
Ahmadmhk
AhmadmhkOP7mo ago
No description
Dennis Koch
Dennis Koch7mo ago
Check the name of the first class. You have a typo
Ahmadmhk
AhmadmhkOP7mo ago
here is also the model
No description
Ahmadmhk
AhmadmhkOP7mo ago
one is time and the other is status
Vp
Vp7mo ago
Your file name is AppointementTime.php notice extra e in class name, I wonder how you import correctly in your casts
Ahmadmhk
AhmadmhkOP7mo ago
yeah i change the name of the file and it is working now thank you
Dan Harrin
Dan Harrin7mo ago
->options(AppointmentTime::class) not ->options([AppointmentTime::class])
Dennis Koch
Dennis Koch7mo ago
Good morning. We already solved this issue 😅 You can go on. Nothing to see here.
Dan Harrin
Dan Harrin7mo ago
i didnt see where that bit was fixed lol oh here mb
Want results from more Discord servers?
Add your server