databaseRegistry->getCurrentDatabase(); $tables = $this->tableRegistry->getAllTables(); // Convert to array for pagination $tablesArray = array_map(fn ($table) => $table->toArray(), $tables); // Paginate tables $paginationRequest = PaginationRequest::first(limit: 50, sortField: 'name'); $paginator = $this->paginationService->forArray($tablesArray); $paginationResponse = $paginator->paginate($paginationRequest); // Generate table $tableData = array_map( fn ($table) => [ 'name' => $table['name'], 'row_count' => $table['row_count'], 'size_mb' => $table['size_mb'], 'engine' => $table['engine'], 'collation' => $table['collation'], ], $paginationResponse->data ); $table = $this->tableGenerator->generate($tableData); $data = [ 'title' => 'Database Browser', 'database' => $database->toArray(), 'table' => $table->render(), 'table_count' => count($tables), 'pagination' => [ 'current_page' => $paginationResponse->meta->currentPage, 'total_pages' => $paginationResponse->meta->totalPages, 'total_items' => $paginationResponse->meta->totalCount, 'items_per_page' => $paginationResponse->request->limit, ], ]; return new ViewResult( template: 'database/browser', metaData: new MetaData('Database Browser', 'Admin - Database Browser'), data: $data ); } }