add multiple select

i want something like screen. do u know any good plugin for that ?
No description
7 Replies
gigiloouu
gigiloouuOP2mo ago
like when i click add brand it should add new selection form like this and save all in my db next
DariusIII
DariusIII2mo ago
Was about to paste the same link, lol
gigiloouu
gigiloouuOP2mo ago
lol thanks i thought that, that was plugin... like i found some plugins for that but.. okay thanks u again guys
Lara Zeus
Lara Zeus2mo ago
there is #awcodes-table-repeater the diff is its looks like a table instead of a grid
gigiloouu
gigiloouuOP2mo ago
guys
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('internal_company_name')
->label('სახელი')
->required(),

Forms\Components\TextInput::make('identification_code')
->label('საიდენტიფიკაციო კოდი')
->required(),
Repeater::make('director_id')
->label('დირექტორები')
->required()
->columnSpanFull()
->schema([
Select::make('role')
->options(
\App\Models\Directors::all()->pluck('name', 'id')
)
->disableOptionsWhenSelectedInSiblingRepeaterItems()

->columnSpanFull()
->label('აირჩიეთ დირექტორი')
->required(),
])
->columns(2)
]);
}
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('internal_company_name')
->label('სახელი')
->required(),

Forms\Components\TextInput::make('identification_code')
->label('საიდენტიფიკაციო კოდი')
->required(),
Repeater::make('director_id')
->label('დირექტორები')
->required()
->columnSpanFull()
->schema([
Select::make('role')
->options(
\App\Models\Directors::all()->pluck('name', 'id')
)
->disableOptionsWhenSelectedInSiblingRepeaterItems()

->columnSpanFull()
->label('აირჩიეთ დირექტორი')
->required(),
])
->columns(2)
]);
}
my form looks like that
Array to string conversion (Connection: mysql, SQL: insert into `holding_companies` (`internal_company_name`, `identification_code`, `director_id`, `updated_at`, `created_at`) values (fafa, ffa, ?, 2024-10-23 12:08:59, 2024-10-23 12:08:59))
Array to string conversion (Connection: mysql, SQL: insert into `holding_companies` (`internal_company_name`, `identification_code`, `director_id`, `updated_at`, `created_at`) values (fafa, ffa, ?, 2024-10-23 12:08:59, 2024-10-23 12:08:59))
like repeater cant save. how i can save selected director_ids in my table?
LeandroFerreira
LeandroFerreira2mo ago
We recommend that you store repeater data with a JSON column in your database. Additionally, if you're using Eloquent, make sure that column has an array cast. https://filamentphp.com/docs/3.x/forms/fields/repeater#overview
Want results from more Discord servers?
Add your server