F
Filament3w ago
zidd

Bulk Action Button on Modal Submit

I'm trying to create an action to add transaction data to delivery data. So i've view delivery page on that file i have function to open add transaction modal like this
ViewDelivery.php
public function addTransactionAction(): Action
{
return Action::make('addTransaction')
->label('Add Transaction')
->modal()
->modalContent(fn (Delivery $delivery): View => view(
'filament.modals.transaction-list',
['delivery' => $delivery]
))
->action();
}
ViewDelivery.php
public function addTransactionAction(): Action
{
return Action::make('addTransaction')
->label('Add Transaction')
->modal()
->modalContent(fn (Delivery $delivery): View => view(
'filament.modals.transaction-list',
['delivery' => $delivery]
))
->action();
}
And that will render a livewire component like this
ListTransaction.php

Delivery $delivery;
public function table(Table $table): Table
{
return $table
->query(Transaction::query())
->columns([
Tables\Columns\TextColumn::make('transaction_number')
->searchable(),
Tables\Columns\TextColumn::make('customer_name')
->searchable(),
])
->filters([
//
])
->actions([
//
])
->bulkActions([
BulkAction::make('select')
->deselectRecordsAfterCompletion(),
]);
}

public function render(): View
{
return view('livewire.transaction.list-transaction');
}
ListTransaction.php

Delivery $delivery;
public function table(Table $table): Table
{
return $table
->query(Transaction::query())
->columns([
Tables\Columns\TextColumn::make('transaction_number')
->searchable(),
Tables\Columns\TextColumn::make('customer_name')
->searchable(),
])
->filters([
//
])
->actions([
//
])
->bulkActions([
BulkAction::make('select')
->deselectRecordsAfterCompletion(),
]);
}

public function render(): View
{
return view('livewire.transaction.list-transaction');
}
Can i set the bulk action submit on the modal submit? I want to set delivery_id on transactions table when modal submit is triggered
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server