F
Filament•13mo ago
brahim

How can i save name of select and not id in db

How can i save name of select and not id in db
7 Replies
Lara Zeus
Lara Zeus•13mo ago
show your code to understand 🙂
brahim
brahimOP•13mo ago
Select::make('category_id') ->label('Catégorie') ->options(Category::all()->pluck('name', 'id')) ->required() ->preload() ->live(onBlur: true) ->reactive() ->searchable()
Lara Zeus
Lara Zeus•13mo ago
pluck('name', 'name')
brahim
brahimOP•13mo ago
but how can i make relationship by name ??
Lara Zeus
Lara Zeus•13mo ago
not following? do you mean the name is a relationship?
brahim
brahimOP•13mo ago
yes i have now relation by id
Dennis Koch
Dennis Koch•13mo ago
Why would you want to do that? A relationship should rely on a unique ID and not a name.
Want results from more Discord servers?
Add your server