Skip to content

Commit e7732ef

Browse files
authored
Merge pull request #122 from devmount/fix-drawer-prefill
Fix prefilling owner id in drawer form
2 parents 146feaf + a764a6a commit e7732ef

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

app/Filament/Relations/PositionsRelationManager.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Filament\Tables\Actions;
1111
use Filament\Tables\Columns;
1212
use Filament\Tables\Table;
13+
use Livewire\Component;
1314

1415
class PositionsRelationManager extends RelationManager
1516
{
@@ -35,12 +36,12 @@ public function table(Table $table): Table
3536
Columns\ToggleColumn::make('remote')
3637
->label(__('remote')),
3738
])
38-
->filters([
39-
//
40-
])
4139
->headerActions([
4240
Actions\CreateAction::make()
4341
->icon('tabler-plus')
42+
->afterFormFilled(function (Component $livewire) {
43+
$livewire->mountedTableActionsData[0]['invoice_id'] = $this->ownerRecord->id;
44+
})
4445
->form(PositionResource::formFields())
4546
->slideOver()
4647
->modalWidth(MaxWidth::TwoExtraLarge),

app/Filament/Relations/ProjectsRelationManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function table(Table $table): Table
5757
Actions\Action::make('create')
5858
->icon('tabler-plus')
5959
->label(__('create'))
60-
->beforeFormFilled(function (Component $livewire) {
60+
->afterFormFilled(function (Component $livewire) {
6161
$livewire->mountedTableActionsData[0]['client_id'] = $this->ownerRecord->id;
6262
})
6363
->form(ProjectResource::formFields(useSection: false))

0 commit comments

Comments
 (0)