Select option Concat
I want to show options with item_price and item_number combine
like below
J94UUdLL-(5000)
Solution:Jump to solution
In options you can return any array/collection so you just need to write your own logic in there to get an array of keys/values as you would any other way in PHP/Laravel.
You could use mapWithKeys to achieve this, something like this would work:
```php
Select::make('author_id')...
7 Replies
If you're also likely to use that format elsewhere in your app consider adding a virtual column to the table so you can reference it as if it were a regular column
i want dropdown options. and I don't want by searching.
What does your code currently look like and what have you tried?
Select::make('author_id')
->label('Author')
->options(Lead::all()->pluck('lead_name', 'id'))
i want otpions like lead_name-(lead_price)
Solution
In options you can return any array/collection so you just need to write your own logic in there to get an array of keys/values as you would any other way in PHP/Laravel.
You could use mapWithKeys to achieve this, something like this would work:
Working fine
Thank You so much