I am working on a Laravel Filament project and I have a problem with grouping a resource by blood group. I have an array that maps blood group ids to blood group names, like this:
I store the blood group id as an integer in the database, but I want to display the blood group name in the resource. However, when I use the groups method, it shows the id instead of the name, like this:
->groups([ 'required_on', 'blood_group', // this shows the id, not the name])
->groups([ 'required_on', 'blood_group', // this shows the id, not the name])
For example, it shows "Blood group: 1" instead of "Blood group: A+". How can I fix this?