Skip to content
This repository was archived by the owner on Feb 14, 2026. It is now read-only.

Commit 7feedb4

Browse files
committed
Refactor resource table description retrieval methods for clarity and efficiency
1 parent 9ae713d commit 7feedb4

File tree

3 files changed

+2
-16
lines changed

3 files changed

+2
-16
lines changed

resources/views/resources/pages/index/column-has-description-above.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
livewire({{ $getPageClass('index') }}::class)
77
->assertTableColumnHasDescription($column, $content, $record, 'above');
88
})->with([
9-
@foreach ($getResourceTableTextColumnsWithDescriptionAboveAndContent() as $column => $content)
9+
@foreach ($getResourceTableTextColumnsWithDescriptionAbove()->mapWithKeys(fn (Filament\Tables\Columns\TextColumn $column) => [$column->getName() => $column->getDescriptionAbove()]) as $column => $content)
1010
['{{ $column }}', '{{ $content }}'],
1111
@endforeach
1212
]);

resources/views/resources/pages/index/column-has-description-below.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
livewire({{ $getPageClass('index') }}::class)
77
->assertTableColumnHasDescription($column, $content, $record, 'below');
88
})->with([
9-
@foreach ($getResourceTableTextColumnsWithDescriptionBelowAndContent() as $column => $content)
9+
@foreach ($getResourceTableTextColumnsWithDescriptionBelow()->mapWithKeys(fn (Filament\Tables\Columns\TextColumn $column) => [$column->getName() => $column->getDescriptionBelow()]) as $column => $content)
1010
['{{ $column }}', '{{ $content }}'],
1111
@endforeach
1212
]);

src/Concerns/Resources/InteractsWithTables.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -156,23 +156,9 @@ public function getResourceTableTextColumnsWithDescriptionAbove(): Collection
156156
->filter(fn (TextColumn $column): bool => filled($column->getDescriptionAbove()));
157157
}
158158

159-
public function getResourceTableTextColumnsWithDescriptionAboveAndContent(): array
160-
{
161-
return $this->getResourceTableTextColumnsWithDescriptionAbove()
162-
->mapWithKeys(fn (TextColumn $column): array => [$column->getName() => $column->getDescriptionAbove()])
163-
->all();
164-
}
165-
166159
public function getResourceTableTextColumnsWithDescriptionBelow(): Collection
167160
{
168161
return $this->getResourceTableTextColumns()
169162
->filter(fn (TextColumn $column): bool => filled($column->getDescriptionBelow()));
170163
}
171-
172-
public function getResourceTableTextColumnsWithDescriptionBelowAndContent(): array
173-
{
174-
return $this->getResourceTableTextColumnsWithDescriptionBelow()
175-
->mapWithKeys(fn (TextColumn $column): array => [$column->getName() => $column->getDescriptionBelow()])
176-
->all();
177-
}
178164
}

0 commit comments

Comments
 (0)