select field display id of record in edit page
hello guys i have a form with a select option field like this:
i set a label for each option but in edit page it doesn't have any label, so display its id like in the image
what should i do for this?
Select::make('variety_detail_id') ->options( function (callable $get) { if ($get('product_id')) { $category_id = Product::where(['id' => $get('product_id')])->get()[0]['category_id']; $variety_id = Category::where('id', $category_id)->get()[0]['variety_id']; return VarietyDetail::where('variety_id', $variety_id)->get()||->pluck('value', 'id')||; } } )
i set a label for each option but in edit page it doesn't have any label, so display its id like in the image
what should i do for this?

Solution
You would add the relationship then follow the documentation:
https://filamentphp.com/docs/3.x/forms/fields/select#customizing-the-relationship-query
or similar depending on your code
https://filamentphp.com/docs/3.x/forms/fields/select#customizing-the-relationship-query
or similar depending on your code