Selva
Selva
FFilament
Created by Selva on 10/7/2024 in #❓┊help
How to display two different widgets in dashboard page side by side?
No description
4 replies
FFilament
Created by Selva on 9/10/2024 in #❓┊help
Get the parent id inside child repeater form
I have a nested form using repeater like, main form -> child repeater form -> grandchild repeater form. Here I need to take the id of main form and insert into grandchild table as main_form_id. I have tried few solutions but not working, This is my form,
return $form
->schema([
// Main form
Forms\Components\TextInput::make('name')->required()->maxLength(255),

// child form
Forms\Components\Repeater::make('groups')->relationship()->schema([
Forms\Components\TextInput::make('name')->required(),

// grand child form
Forms\Components\Repeater::make('requests')->relationship()->schema([
Forms\Components\TextInput::make('name')->required(),
])->mutateRelationshipDataBeforeCreateUsing(function (array $data, Get $get) {
// $data['project_id'] = $get('../../id');
// dd($get());
// dd($data);
return $data;
}),
])
]);
return $form
->schema([
// Main form
Forms\Components\TextInput::make('name')->required()->maxLength(255),

// child form
Forms\Components\Repeater::make('groups')->relationship()->schema([
Forms\Components\TextInput::make('name')->required(),

// grand child form
Forms\Components\Repeater::make('requests')->relationship()->schema([
Forms\Components\TextInput::make('name')->required(),
])->mutateRelationshipDataBeforeCreateUsing(function (array $data, Get $get) {
// $data['project_id'] = $get('../../id');
// dd($get());
// dd($data);
return $data;
}),
])
]);
6 replies