where('server_id', $this->server->id); } protected static ?string $heading = ''; protected function getTableColumns(): array { return [ IconColumn::make('type') ->icon(fn (Site $record) => 'icon-'.$record->type) ->tooltip(fn (Site $record) => $record->type) ->width(24), TextColumn::make('domain') ->searchable() ->sortable(), TextColumn::make('tags') ->label('Tags') ->badge() ->icon('heroicon-o-tag') ->formatStateUsing(fn ($state) => $state->name) ->color(fn ($state) => $state->color) ->searchable() ->sortable(), TextColumn::make('created_at') ->formatStateUsing(fn (Site $record) => $record->created_at_by_timezone) ->sortable(), TextColumn::make('status') ->label('Status') ->badge() ->color(fn (Site $site) => Site::$statusColors[$site->status]) ->searchable() ->sortable(), ]; } public function getTable(): Table { return $this->table ->recordUrl(fn (Site $record) => View::getUrl(parameters: ['server' => $this->server, 'site' => $record])) ->actions([ Action::make('settings') ->label('Settings') ->icon('heroicon-o-cog-6-tooth') ->authorize(fn (Site $record) => auth()->user()->can('update', [$record, $this->server])) ->url(fn (Site $record) => Settings::getUrl(parameters: ['server' => $this->server, 'site' => $record])), ]); } }