@php
$actions = $getActions();
$columns = $getColumns();
$contentFooter = $getContentFooter();
$header = $getHeader();
$headerActions = $getHeaderActions();
$heading = $getHeading();
$isSearchVisible = $isSearchable();
$isFiltersDropdownVisible = $isFilterable();
$isColumnToggleFormVisible = $hasToggleableColumns();
$columnsCount = count($columns);
if (count($actions)) $columnsCount++;
if ($isSelectionEnabled()) $columnsCount++;
$getHiddenClasses = function (\Filament\Tables\Columns\Column $column): ?string {
if ($breakpoint = $column->getHiddenFrom()) {
return match ($breakpoint) {
'sm' => 'sm:hidden',
'md' => 'md:hidden',
'lg' => 'lg:hidden',
'xl' => 'xl:hidden',
'2xl' => '2xl:hidden',
};
}
if ($breakpoint = $column->getVisibleFrom()) {
return match ($breakpoint) {
'sm' => 'hidden sm:table-cell',
'md' => 'hidden md:table-cell',
'lg' => 'hidden lg:table-cell',
'xl' => 'hidden xl:table-cell',
'2xl' => 'hidden 2xl:table-cell',
};
}
return null;
};
@endphp
@if ($header)
{{ $header }}
@elseif ($heading || $headerActions)
{{ $heading }}
{{ $getDescription() }}
@endif
@if ($isSearchVisible || $isFiltersDropdownVisible || $isColumnToggleFormVisible)
@if ($isSearchVisible)
@endif
@if ($isFiltersDropdownVisible)
@endif
@if ($isColumnToggleFormVisible)
@endif
@endif
config('tables.dark_mode'),
'rounded-t-xl' => ! $renderHeader,
'border-t' => $renderHeader,
])
x-bind:class="{
'rounded-t-xl': ! hasHeader,
'border-t': hasHeader,
}"
>
@if (($records = $getRecords())->count())
@if ($isSelectionEnabled())
@endif
@foreach ($columns as $column)
{{ $column->getLabel() }}
@endforeach
@if (count($actions))
|
@endif
@if ($isSelectionEnabled())
@endif
@foreach ($records as $record)
@if ($isSelectionEnabled())
@endif
@foreach ($columns as $column)
@php
$column->record($record);
@endphp
{{ $column }}
@endforeach
@if (count($actions))
@endif
@endforeach
@if ($contentFooter)
{{ $contentFooter->with(['columns' => $columns, 'records' => $records]) }}
@endif
@else
@if ($emptyState = $getEmptyState())
{{ $emptyState }}
@else
{{ $getEmptyStateHeading() }}
{{ $getEmptyStateDescription() }}
@endif
@endif
@if ($isPaginationEnabled())
config('tables.dark_mode'),
])>
@endif