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