-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a49309
commit 33e8b5c
Showing
3 changed files
with
58 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Livewire\Beneficiary; | ||
|
||
use Filament\Forms\Concerns\InteractsWithForms; | ||
use Filament\Forms\Contracts\HasForms; | ||
use Filament\Tables; | ||
use Filament\Tables\Concerns\InteractsWithTable; | ||
use Filament\Tables\Contracts\HasTable; | ||
use Filament\Tables\Table; | ||
use Illuminate\Contracts\View\View; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Livewire\Component; | ||
|
||
class ListDocuments extends Component implements HasForms, HasTable | ||
{ | ||
use InteractsWithForms; | ||
use InteractsWithTable; | ||
|
||
public ?Model $record = null; | ||
|
||
public function table(Table $table): Table | ||
{ | ||
return $table | ||
->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'); | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
resources/views/livewire/beneficiary/list-documents.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div> | ||
{{ $this->table }} | ||
</div> |