|
|
@@ -2,7 +2,6 @@
|
|
|
|
|
|
namespace App\Http\Traits;
|
|
|
|
|
|
-use Illuminate\Pagination\Paginator;
|
|
|
use Illuminate\Pagination\LengthAwarePaginator;
|
|
|
use stdClass;
|
|
|
|
|
|
@@ -17,6 +16,9 @@ trait PagingTrait
|
|
|
{
|
|
|
$request = Request();
|
|
|
|
|
|
+ $allowed = ['search', 'keyword', 'category', 'sort', 'order', 'perPage'];
|
|
|
+ $query = $request->only($allowed);
|
|
|
+
|
|
|
return new LengthAwarePaginator($items, $total, $perPage, $page, [
|
|
|
'path' => ($path ?? $request->url()),
|
|
|
'query' => ($query ?? $request->query())
|