F
Filament3mo 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
NimaOP3mo 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
toeknee3mo ago
If you use Grid you can pass a parameter in i.e. contenxt == view do X context == edit do Y
Nima
NimaOP3mo ago
can you show me? because i have searched for grid but i found nothing.
toeknee
toeknee3mo 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
NimaOP3mo 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
toeknee3mo ago
What?
Nima
NimaOP3mo ago
form and getRelations has separate content that insert below each other.
toeknee
toeknee3mo ago
Correct and it always will
Nima
NimaOP3mo ago
i cant apply grid for form and getRelations
toeknee
toeknee3mo ago
So you want to merge the relationship manager and the form, you can't do that
Nima
NimaOP3mo ago
hmmmm you understand what i need.
toeknee
toeknee3mo 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
NimaOP3mo ago
thanks for your help i will try that.
Want results from more Discord servers?
Add your server