F
Filament17mo ago
Kleis

Dynamic title in tabs

Is there a way to bind the tap headers in a modal to dynamic data from the record/mountUsing ? This part "Tabs\Tab::make('Tab1')->schema([" Gist : https://gist.github.com/MORA99/6362fac65e6fcfff26b810e91bf060fc
Gist
UsageAction.php
GitHub Gist: instantly share code, notes, and snippets.
1 Reply
Kleis
KleisOP17mo ago
Boiled down example
return \Filament\Tables\Actions\Action::make('Anvendelse')
->mountUsing(function (Forms\ComponentContainer $form, \App\Models\Ownership $record) {
return $form->fill([
'Tab1' => $record->name,
'Tab2' => $record->apartment_name,
]);
})
->action(function ($record, array $data): void {})
->form([
Tabs::make('Heading')
->tabs([
Tabs\Tab::make('Tab1')->schema([
]),
Tabs\Tab::make('Tab2')->schema([
]),
])->columns(2)
]);
return \Filament\Tables\Actions\Action::make('Anvendelse')
->mountUsing(function (Forms\ComponentContainer $form, \App\Models\Ownership $record) {
return $form->fill([
'Tab1' => $record->name,
'Tab2' => $record->apartment_name,
]);
})
->action(function ($record, array $data): void {})
->form([
Tabs::make('Heading')
->tabs([
Tabs\Tab::make('Tab1')->schema([
]),
Tabs\Tab::make('Tab2')->schema([
]),
])->columns(2)
]);
Want results from more Discord servers?
Add your server