Select does not load default value in Edit Action with relationship
Hello, Guys, I have a Select that when I enter the Edit Action it is not marking the default value that comes from the relationship. The relationship is being loaded normally and showing the value in the Select Label. I've already tried select with relationship and options and nothing. See the code as relationship:
The relationship is both belongsTo and it is working correctly, I tested it in tinker.
$sub1->subpasta->parent
= App\Models\Categoria {#7159 id: 5, uuid: "0a3beef6-2d1c-46e0-af7e-915435c9fbec", parent_id: null, slug: "pasta-4", label: "Pasta 4", Does anyone know how to make this mark the default value correctly? Thanks.
= App\Models\Categoria {#7159 id: 5, uuid: "0a3beef6-2d1c-46e0-af7e-915435c9fbec", parent_id: null, slug: "pasta-4", label: "Pasta 4", Does anyone know how to make this mark the default value correctly? Thanks.
4 Replies
Shouldn't it be something like
Select::make('subpasta.parent_id')
?I did it this way and it continues the same way. Without displaying the default.
Are the rest of the fields populated properly?
Yes