diff --git a/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/ViewBeneficiary.php b/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/ViewBeneficiary.php index ef757963..cc7a210a 100644 --- a/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/ViewBeneficiary.php +++ b/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/ViewBeneficiary.php @@ -8,7 +8,7 @@ use App\Filament\Organizations\Resources\BeneficiaryResource; use App\Infolists\Components\EnumEntry; use Filament\Infolists\Components\Actions\Action; -use Filament\Infolists\Components\RepeatableEntry; +use Filament\Infolists\Components\Livewire; use Filament\Infolists\Components\Section; use Filament\Infolists\Components\TextEntry; use Filament\Infolists\Infolist; @@ -169,18 +169,7 @@ private function documents(): Section ->link(), ]) ->schema([ - - RepeatableEntry::make('documents') - ->label('') - ->contained(false) - ->columns() - ->schema([ - TextEntry::make('type') - ->label(__('beneficiary.section.documents.labels.type')) - ->formatStateUsing(fn ($state) => $state->label()), - TextEntry::make('name') - ->label(__('beneficiary.section.documents.labels.name')) - ]), + Livewire::make(\App\Livewire\Beneficiary\ListDocuments::class), ]); } } diff --git a/app/Livewire/Beneficiary/ListDocuments.php b/app/Livewire/Beneficiary/ListDocuments.php new file mode 100644 index 00000000..1eacfdd2 --- /dev/null +++ b/app/Livewire/Beneficiary/ListDocuments.php @@ -0,0 +1,53 @@ +relationship(fn () => $this->record->documents()) + ->columns([ + Tables\Columns\TextColumn::make('type') + ->label(__('beneficiary.section.documents.labels.type')) + ->formatStateUsing(fn ($state) => $state->label()), + Tables\Columns\TextColumn::make('name') + ->label(__('beneficiary.section.documents.labels.name')), + ]) + ->filters([ + // + ]) + ->actions([ + // + ]) + ->bulkActions([ + Tables\Actions\BulkActionGroup::make([ + // + ]), + ]) + ->defaultPaginationPageOption(5); + } + + public function render(): View + { + return view('livewire.beneficiary.list-documents'); + } +} diff --git a/resources/views/livewire/beneficiary/list-documents.blade.php b/resources/views/livewire/beneficiary/list-documents.blade.php new file mode 100644 index 00000000..c3fedc4a --- /dev/null +++ b/resources/views/livewire/beneficiary/list-documents.blade.php @@ -0,0 +1,3 @@ +