screen->attachQuery(function (object $q) use ($ctx): void { $col = $ctx->column($ctx->screen->requestedOrderby($q)); $args = $col && $col->sort ? $ctx->type($col)?->sortArgs($col) : null; if ($args !== null) { $ctx->screen->applyOrder($q, $args); } }); }); } }