How can use table of filament inside Wizard\Step ?

The situation is the following, I need to generate a final calculation based on many records from different tables that is created for several users... I pass several records to this calculation and I want to show the records from some tables that meet an initial date that I select in the first step, and have within this the option to edit, delete and paginate them as well... is there any way I can do this with the steps? For now I was thinking up something custom with livewire, but if I can do it with filament, if there is a way I prefer that way... is there anything that can help me solve something like this with filament? Thank you
No description
4 Replies
TranceCode
TranceCode2w ago
I have this code right now
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\Wizard::make([
Forms\Components\Wizard\Step::make('Seleccionar Mes de cobro')
->schema([
Forms\Components\TextInput::make('mescobro')->type('month')
->label('Mes en que se cobrara')
->required()
->afterStateUpdated(function ($state, callable $set) {
$set('mescobro', $state);
}),
Forms\Components\DatePicker::make('vencimiento')
->label('Seleccione una fecha de vencimiento')
->required(),
])
->columns(2),
Forms\Components\Wizard\Step::make('Seleccionar Medidores')
->schema([
Forms\Components\Grid::make()
->schema([
Forms\Components\Placeholder::make('table_placeholder')
->content(function (callable $get) {
$mescobro = $get('mescobro');
return view('filament.tables.gauges-table', compact('mescobro'));
})
])
]),
Forms\Components\Wizard\Step::make('Seleccionar Calderas')
->schema([]),
Forms\Components\Wizard\Step::make('Ingresos')
->schema([]),
Forms\Components\Wizard\Step::make('Seleccionar Egresos')
->schema([]),
Forms\Components\Wizard\Step::make('Seleccionar Multas')
->schema([]),
Forms\Components\Wizard\Step::make('Seleccionar condonaciones')
->schema([]),
Forms\Components\Wizard\Step::make('Generar Gasto Común')
->schema([]),
])
->columnSpanFull()
]);
}
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\Wizard::make([
Forms\Components\Wizard\Step::make('Seleccionar Mes de cobro')
->schema([
Forms\Components\TextInput::make('mescobro')->type('month')
->label('Mes en que se cobrara')
->required()
->afterStateUpdated(function ($state, callable $set) {
$set('mescobro', $state);
}),
Forms\Components\DatePicker::make('vencimiento')
->label('Seleccione una fecha de vencimiento')
->required(),
])
->columns(2),
Forms\Components\Wizard\Step::make('Seleccionar Medidores')
->schema([
Forms\Components\Grid::make()
->schema([
Forms\Components\Placeholder::make('table_placeholder')
->content(function (callable $get) {
$mescobro = $get('mescobro');
return view('filament.tables.gauges-table', compact('mescobro'));
})
])
]),
Forms\Components\Wizard\Step::make('Seleccionar Calderas')
->schema([]),
Forms\Components\Wizard\Step::make('Ingresos')
->schema([]),
Forms\Components\Wizard\Step::make('Seleccionar Egresos')
->schema([]),
Forms\Components\Wizard\Step::make('Seleccionar Multas')
->schema([]),
Forms\Components\Wizard\Step::make('Seleccionar condonaciones')
->schema([]),
Forms\Components\Wizard\Step::make('Generar Gasto Común')
->schema([]),
])
->columnSpanFull()
]);
}
any idea friends?
Dennis Koch
Dennis Koch2w ago
You can resuse the Blade components, but you can't use the table builder inside the form builder. So I'd go with a ViewField
TranceCode
TranceCode2w ago
ok bro, i will check this, thank you so much!
TranceCode
TranceCode7d ago
I do it bro, using dynamic date from the step one with wizard, thank you so much for the tips about ViewField