Custom Modal Issue
I have been trying this for hours but not working, i want to create a livewire custom modal with filament form , i followed the docs well , but instead i got this error and i have not put any infolist in my code
This is my OrderResource
This is my 'App/Livewire' and my blade
Filament\Resources\Pages\ListRecords::form(): Argument #1 ($form) must be of type Filament\Forms\Form, Filament\Infolists\Infolist given, called in /Users/sadiqgoni/hotel-management/vendor/filament/infolists/src/Concerns/InteractsWithInfolists.php on line 56
Filament\Resources\Pages\ListRecords::form(): Argument #1 ($form) must be of type Filament\Forms\Form, Filament\Infolists\Infolist given, called in /Users/sadiqgoni/hotel-management/vendor/filament/infolists/src/Concerns/InteractsWithInfolists.php on line 56
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\ViewAction::make(),
Tables\Actions\DeleteAction::make(),
// Custom Action for the Payment Modal
Action::make('openPaymentModal')
->label('Make Payment')
->icon('heroicon-o-banknotes')
->modalHeading('Make Payment')
->modalWidth('lg')
->modalContent(fn (Order $record) => view('livewire.table-order-component', ['record' => $record]))
->action(fn (Order $record) => null),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\ViewAction::make(),
Tables\Actions\DeleteAction::make(),
// Custom Action for the Payment Modal
Action::make('openPaymentModal')
->label('Make Payment')
->icon('heroicon-o-banknotes')
->modalHeading('Make Payment')
->modalWidth('lg')
->modalContent(fn (Order $record) => view('livewire.table-order-component', ['record' => $record]))
->action(fn (Order $record) => null),
])
class TableOrderComponent extends Component implements HasForms
{
use InteractsWithForms;
public function form(Form $form): Form
{
return $form
->schema([
Select::make('paymentMethod')
->label('Payment Method')
->options([
'cash' => 'Cash',
'card' => 'Card',
])
->required(),])
public function render()
{
return view('livewire.table-order-component');
}
class TableOrderComponent extends Component implements HasForms
{
use InteractsWithForms;
public function form(Form $form): Form
{
return $form
->schema([
Select::make('paymentMethod')
->label('Payment Method')
->options([
'cash' => 'Cash',
'card' => 'Card',
])
->required(),])
public function render()
{
return view('livewire.table-order-component');
}
<div>
<form wire:submit.prevent="submit">
{{ $this->form }}
<button type="submit" class="btn btn-primary">
Make Payment
</button>
</form>
</div>
<div>
<form wire:submit.prevent="submit">
{{ $this->form }}
<button type="submit" class="btn btn-primary">
Make Payment
</button>
</form>
</div>
0 Replies