bayusamara
bayusamara
FFilament
Created by gizmojo on 1/27/2024 in #❓┊help
Create select option form without relationship
have the same problem today i get the option from
$options = Product::select('name')->distinct()->get()->pluck('name','name');
$options = Product::select('name')->distinct()->get()->pluck('name','name');
and this createOptionUsing works for me
->createOptionForm([
Forms\Components\TextInput::make('name')
->required(),
])
->createOptionUsing(function ($data) use ($options) {
$options->push($data["name"]);
return $options->last();
})
->createOptionForm([
Forms\Components\TextInput::make('name')
->required(),
])
->createOptionUsing(function ($data) use ($options) {
$options->push($data["name"]);
return $options->last();
})
2 replies