-
-
Notifications
You must be signed in to change notification settings - Fork 407
Closed
Description
I'm testing the newly introduced cursorPaginate, all seems to work fine, however using inRandomOrder results in:
{
"message": "array_flip(): Can only flip string and integer values, entry skipped",
"exception": "ErrorException",
"file": "/home/user/www/src/api/vendor/laravel/framework/src/Illuminate/Collections/Collection.php",
"line": 382,
..
Is this expected or a known bug? I'm simple calling a custom filter and works fine using paginate:
<?php
namespace App\Support\QueryBuilder\Sorters;
use Illuminate\Database\Eloquent\Builder;
use Spatie\QueryBuilder\Sorts\Sort;
class RandomSorter implements Sort
{
public function __invoke(Builder $query, bool $descending, string $property): Builder
{
return $query->inRandomOrder();
}
}
Thanks!
Metadata
Metadata
Assignees
Labels
No labels