F
Filament2mo ago
Nima

Custom grid structure in filament

I need to make some structural changes to the page at /admin/models/{model}/edit. This page contains a form to edit the model and uses the getRelations method to manage model relationships. Please refer to the attached photo for clarification.
No description
No description
14 Replies
Nima
Nima2mo ago
i cant use grid here. i have two methods. form and getRelations. each of them are importing their content in separate div tag
toeknee
toeknee2mo ago
If you use Grid you can pass a parameter in i.e. contenxt == view do X context == edit do Y
Nima
Nima2mo ago
can you show me? because i have searched for grid but i found nothing.
toeknee
toeknee2mo ago
return $form->schema([
Grid::make(12)->schema([
TextInput::make('first_name')->columnSpan(6),
TextInput::make('last_name')->columnSpan(6),
])
]);
return $form->schema([
Grid::make(12)->schema([
TextInput::make('first_name')->columnSpan(6),
TextInput::make('last_name')->columnSpan(6),
])
]);
Grid is a field of the form.
Nima
Nima2mo ago
I know that and this is working in this state. but i need to apply grid column in $form and $relations.
No description
toeknee
toeknee2mo ago
What?
Nima
Nima2mo ago
form and getRelations has separate content that insert below each other.
toeknee
toeknee2mo ago
Correct and it always will
Nima
Nima2mo ago
i cant apply grid for form and getRelations
toeknee
toeknee2mo ago
So you want to merge the relationship manager and the form, you can't do that
Nima
Nima2mo ago
hmmmm you understand what i need.
toeknee
toeknee2mo ago
You need to create a custom livewire component which has tables and accepts an id for the data being loaded that would then allow you to render a table anywhere
Nima
Nima2mo ago
thanks for your help i will try that.
Want results from more Discord servers?
Add your server