diff --git a/app/Http/Controllers/AuthorController.php b/app/Http/Controllers/AuthorController.php index a6069afa3..55a48c556 100644 --- a/app/Http/Controllers/AuthorController.php +++ b/app/Http/Controllers/AuthorController.php @@ -74,7 +74,7 @@ protected function getIndexData() $authorities = Authority::query() ->whereIn('id', $authorityIds) ->with(['translations']) - ->orderByRaw('FIELD(id, ' . $authorityIds->join(',') . ')') + ->orderByRaw('FIELD(id, ' . $authorityIds->map(fn($id) => "'$id'")->join(',') . ')') ->get() ->map(function (Authority $authority, $index) use ($itemCounts) { // Use indexed items_count to speed things up