ffcastaneda
ffcastaneda
FFilament
Created by ffcastaneda on 10/7/2024 in #❓┊help
Form inside Livewire Component:
In a livewire component I want to put a form, in this a select that must take the data from the Bank model. How do I enable new records to be created in the Bank model? public function form(Form $form): Form { return $form ->schema([ Select::make('bank_id') ->searchable() ->inlineLabel() ->translateLabel() ->preload() ->searchDebounce(500) ->loadingMessage('Loading banks...') ->getSearchResultsUsing(fn (string $search): array => Bank::where('bank', 'like', "%{$search}%")->limit(50)->pluck('bank', 'id')->toArray()) ->getOptionLabelUsing(fn ($value): ?string => Bank::find($value)?->name), ])->columns(2) ->statePath('data'); }
3 replies