@php use Filament\Support\Enums\Alignment; use Filament\Support\Enums\VerticalAlignment; use Filament\Support\Facades\FilamentView; use Filament\Tables\Columns\Column; use Filament\Tables\Columns\ColumnGroup; use Filament\Tables\Enums\ActionsPosition; use Filament\Tables\Enums\FiltersLayout; use Filament\Tables\Enums\RecordCheckboxPosition; use Illuminate\Support\Str; $actions = $getActions(); $actionsAlignment = $getActionsAlignment(); $actionsPosition = $getActionsPosition(); $actionsColumnLabel = $getActionsColumnLabel(); $activeFiltersCount = $getActiveFiltersCount(); $columns = $getVisibleColumns(); $collapsibleColumnsLayout = $getCollapsibleColumnsLayout(); $columnsLayout = $getColumnsLayout(); $content = $getContent(); $contentGrid = $getContentGrid(); $contentFooter = $getContentFooter(); $filterIndicators = $getFilterIndicators(); $hasColumnGroups = $hasColumnGroups(); $hasColumnsLayout = $hasColumnsLayout(); $hasSummary = $hasSummary(); $header = $getHeader(); $headerActions = array_filter( $getHeaderActions(), fn (\Filament\Tables\Actions\Action | \Filament\Tables\Actions\BulkAction | \Filament\Tables\Actions\ActionGroup $action): bool => $action->isVisible(), ); $headerActionsPosition = $getHeaderActionsPosition(); $heading = $getHeading(); $group = $getGrouping(); $bulkActions = array_filter( $getBulkActions(), fn (\Filament\Tables\Actions\BulkAction | \Filament\Tables\Actions\ActionGroup $action): bool => $action->isVisible(), ); $groups = $getGroups(); $description = $getDescription(); $isGroupsOnly = $isGroupsOnly() && $group; $isReorderable = $isReorderable(); $isReordering = $isReordering(); $areGroupingSettingsVisible = (! $isReordering) && count($groups) && (! $areGroupingSettingsHidden()); $isColumnSearchVisible = $isSearchableByColumn(); $isGlobalSearchVisible = $isSearchable(); $isSearchOnBlur = $isSearchOnBlur(); $isSelectionEnabled = $isSelectionEnabled() && (! $isGroupsOnly); $recordCheckboxPosition = $getRecordCheckboxPosition(); $isStriped = $isStriped(); $isLoaded = $isLoaded(); $hasFilters = $isFilterable(); $filtersLayout = $getFiltersLayout(); $filtersTriggerAction = $getFiltersTriggerAction(); $hasFiltersDialog = $hasFilters && in_array($filtersLayout, [FiltersLayout::Dropdown, FiltersLayout::Modal]); $hasFiltersAboveContent = $hasFilters && in_array($filtersLayout, [FiltersLayout::AboveContent, FiltersLayout::AboveContentCollapsible]); $hasFiltersAboveContentCollapsible = $hasFilters && ($filtersLayout === FiltersLayout::AboveContentCollapsible); $hasFiltersBelowContent = $hasFilters && ($filtersLayout === FiltersLayout::BelowContent); $hasColumnToggleDropdown = $hasToggleableColumns(); $hasHeader = $header || $heading || $description || ($headerActions && (! $isReordering)) || $isReorderable || $areGroupingSettingsVisible || $isGlobalSearchVisible || $hasFilters || count($filterIndicators) || $hasColumnToggleDropdown; $hasHeaderToolbar = $isReorderable || $areGroupingSettingsVisible || $isGlobalSearchVisible || $hasFiltersDialog || $hasColumnToggleDropdown; $pluralModelLabel = $getPluralModelLabel(); $records = $isLoaded ? $getRecords() : null; $searchDebounce = $getSearchDebounce(); $allSelectableRecordsCount = ($isSelectionEnabled && $isLoaded) ? $getAllSelectableRecordsCount() : null; $columnsCount = count($columns); $reorderRecordsTriggerAction = $getReorderRecordsTriggerAction($isReordering); $toggleColumnsTriggerAction = $getToggleColumnsTriggerAction(); if (count($actions) && (! $isReordering)) { $columnsCount++; } if ($isSelectionEnabled || $isReordering) { $columnsCount++; } if ($group) { $groupedSummarySelectedState = $this->getTableSummarySelectedState($this->getAllTableSummaryQuery(), modifyQueryUsing: fn (\Illuminate\Database\Query\Builder $query) => $group->groupQuery($query, model: $getQuery()->getModel())); } $getHiddenClasses = function (Column | ColumnGroup $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