xechino
xechino
FFilament
Created by Vexmachina on 6/1/2024 in #❓┊help
Not able to select newly created options using CreateOptionsForm until refresh
@NickBell, unfortunately, I haven't been able to resolve the issue yet. I've put it aside to revisit in the future, as I haven't had the time to create a new post or investigate further. If you do raise a bug report, please let me know how it goes!
13 replies
FFilament
Created by Vexmachina on 6/1/2024 in #❓┊help
Not able to select newly created options using CreateOptionsForm until refresh
No description
13 replies
FFilament
Created by Vexmachina on 6/1/2024 in #❓┊help
Not able to select newly created options using CreateOptionsForm until refresh
Selecting the newly created model doesn't work when we use a model as a relationship instead of an array of options. Example
->relationship(
name: 'country',
titleAttribute: 'name',
)
->live()
->createOptionForm([
Forms\Components\TextInput::make('name')
])
->createOptionUsing(function (array $data, Forms\Set $set): string {
$country = Country::query()->create($data);
$set['country_id'] = $country->id;
return $country->id;
})
->relationship(
name: 'country',
titleAttribute: 'name',
)
->live()
->createOptionForm([
Forms\Components\TextInput::make('name')
])
->createOptionUsing(function (array $data, Forms\Set $set): string {
$country = Country::query()->create($data);
$set['country_id'] = $country->id;
return $country->id;
})
13 replies