defaultSort('created_at', direction: 'desc') ->columns([ TextColumn::make('id') ->label(__('ID')) ->sortable(), TextColumn::make('type') ->label(__('Type')) ->formatStateUsing(fn (string $state) => Str::upper($state)), TextColumn::make('status') ->label(__('Status')) ->color(OrderStatusRepository::statusColorMatching()) ->formatStateUsing(fn (string $state) => OrderStatusRepository::statusFormatted($state)) ->badge(), TextColumn::make('created_at') ->label(__('Created At')) ->dateTime() ->sortable(), TextColumn::make('region') ->label(__('Region')) ->formatStateUsing(fn (string $state): string => RegionRepository::label($state)) ->searchable(), TextColumn::make('branch.name') ->label(__('Branch')) ->searchable(), TextColumn::make('sender_full_name') ->label(__('Full Name')) ->searchable(), TextColumn::make('phone') ->label(__('Phone')) ->searchable(), IconColumn::make('paid') ->label(sprintf('%s (%s)', __('Paid'), __('This month'))) ->boolean(), ]) ->filters([ TrashedFilter::make(), ]) ->recordActions([ ViewAction::make(), EditAction::make(), ]) ->toolbarActions([ BulkActionGroup::make([ DeleteBulkAction::make(), ForceDeleteBulkAction::make(), RestoreBulkAction::make(), ]), ]); } }