Select option formatting
Good morning filament fans! Is there a way to have a select using a relationship to display 2 columns ? I.e. product code and name? E.g. "WD-001 Wooden blocks"
Solution:Jump to solution
Sorry I did write a reply. I would personally recommend using a virtual column if using MySQL as:
https://laraveldaily.com/post/virtual-db-columns-laravel-migrations-mysql
Otherwise, you can use getOptionLabelUsing(fn($record) => $record->values)...
Laravel Daily
Virtual DB Columns in Laravel Migrations and MySQL
5 Replies
Yes
@toeknee thanks, i'm looking but i cant seem to find in the docs what it is that i need to do, i am guessing the title attribute is the display value?
Solution
Sorry I did write a reply. I would personally recommend using a virtual column if using MySQL as:
https://laraveldaily.com/post/virtual-db-columns-laravel-migrations-mysql
Otherwise, you can use getOptionLabelUsing(fn($record) => $record->values)
Laravel Daily
Virtual DB Columns in Laravel Migrations and MySQL
ah that's brilliant! thank you so much!
Welcomes 🙂