Filament Select Option
Could you kindly suggest an alternative approach that would be more effective than the current course of action? When I fetch the data it's weird as you can see the photo!
21 Replies
It's not weird. It is the value that you set as the key
If you storing different data than you want to ouput, you need to map it back
How can I show like that in my front 100 - 500?
Map it back to your values. Via
match
or an array
Thank you
why not using enums ?
This is a good use-case for an enum, check out the second example here :
https://www.php.net/manual/en/language.enumerations.examples.php
Thank you
I can't use like this.
Probably not... can you show us
getValues()
?Try this instead:
Thank you got it
Pardon I can't fetch to front
This looks ok, what is causing the error above?
I got this error when I'm not dd.
I'm not familiar with the package you are using... (BenSampo\Enum)
Can you show me the code that is causing the error, with more context than just
$job->company_size->description
Actually that's it.
Can you be sure your sent the correct code for your enum class? The error says it’s looking for “10 - 50”, but that’s nowhere to be found in the code you sent. Where did it get that value from? It appears to come from TeamRange::getValues(), but that value isn’t in the code you sent.
That's it
Weird. Where is it pulling “10 - 50” from? Can you search your project for that string?
I think your options array isn't formed correctly. Try this:
Thank you let me check
I removed the package and it's working now.
Nice and simple!
Thanks
I changed to these.