Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Filament\Tables\Columns\IconColumn;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;

class SheltersRelationManager extends RelationManager
{
Expand Down Expand Up @@ -46,6 +47,24 @@ public function table(Table $table): Table
->alignRight()
->shrink(),

TextColumn::make('current_stays_count')
->label(__('app.field.occupancy'))
->counts([
'stays as current_stays_count' => fn (Builder $query) => $query->whereCurrent(),
])
->sortable()
->numeric()
->alignRight()
->shrink(),

TextColumn::make('stays_count')
->label(__('app.field.all_time_beneficiaries'))
->counts('stays')
->sortable()
->numeric()
->alignRight()
->shrink(),

TextColumn::make('country.name')
->label(__('app.field.country'))
->searchable()
Expand Down
2 changes: 2 additions & 0 deletions lang/en/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
'address' => 'Address',
'admins' => 'Administrators',
'age' => 'Age',
'all_time_beneficiaries' => 'All time beneficiaries',
'beneficiary' => 'Beneficiary',
'capacity' => 'Capacity',
'children_count' => 'Number of children',
Expand Down Expand Up @@ -73,6 +74,7 @@
'native_name' => 'Native name',
'not_applicable' => 'Not applicable',
'notes' => 'Observations',
'occupancy' => 'Occupancy',
'options' => 'Options',
'order' => 'Order',
'organization_type' => 'Organization type',
Expand Down
Loading