Change case of relationship name field in a select
Hi all,
Looking for a bit of help on this one: I've got a Select field which works fine with a relationship:
However, the role names are slug format (super_user, account_admin) etc, and I'd like them to appear in the select as "Super User", "Account Admin", etc.
I thought this would work:
But the if I add a logger() statement into the function, it's not even getting called.
Any ideas how I can do this?
Thanks in advance,
Andy
Solution:Jump to solution
Ah, got there, through a different approach (which obviously I'm sure I tried the first time, but c'est la vie):
```
Select::make('roles')
->label("Role")...
4 Replies
Hmm. Nearly there:
$roles is set to:
array:3 [
3 => "User"
2 => "Account Admin"
1 => "Super Admin"
]
But now I have no options in the select - just the "Select an option" entry.
Solution
Ah, got there, through a different approach (which obviously I'm sure I tried the first time, but c'est la vie):
Thanks so much!