*/ protected function getViewData(): array { $tenant = Filament::getTenant(); if (! $tenant instanceof Tenant) { return [ 'tenant' => null, 'runs' => collect(), 'operationsIndexUrl' => route('admin.operations.index'), ]; } /** @var Collection $runs */ $runs = OperationRun::query() ->where('tenant_id', (int) $tenant->getKey()) ->orderByDesc('created_at') ->orderByDesc('id') ->limit(5) ->get([ 'id', 'type', 'status', 'outcome', 'created_at', 'started_at', 'completed_at', ]); return [ 'tenant' => $tenant, 'runs' => $runs, 'operationsIndexUrl' => route('admin.operations.index'), ]; } }