I use createOptionForm() to give users the option of adding a new building to the Select and, in accordance with the documentation, I use createOptionUsing to create my building in the DB :
->createOptionUsing(function (array $data): int { return auth()->user()->syndicate->buildings()->create($data)->getKey();}),
->createOptionUsing(function (array $data): int { return auth()->user()->syndicate->buildings()->create($data)->getKey();}),
Everything works except that my select only displays the building ID in my select. Is it possible to format it too, like the others? If so, how? Thanks in advance for your help
Solution
Hello all, I finally figured out how to do it after a lot of research