Code Duplication    Length = 10-11 lines in 2 locations

src/Queries/BaseQuery.php 2 locations

@@ 297-307 (lines=11) @@
294
     *
295
     * @return \Illuminate\Pagination\LengthAwarePaginator
296
     */
297
    public function paginate($perPage = 15, $pageName = 'page')
298
    {
299
        $page = Paginator::resolveCurrentPage($pageName);
300
        $total = $this->count();
301
        $results = $this->forPage($page, $perPage)->getList();
302
303
        return new LengthAwarePaginator($results, $total, $perPage, $page, [
304
            'path' => Paginator::resolveCurrentPath(),
305
            'pageName' => $pageName,
306
        ]);
307
    }
308
309
    /**
310
     * Get a paginator only supporting simple next and previous links.
@@ 319-328 (lines=10) @@
316
     *
317
     * @return \Illuminate\Pagination\Paginator
318
     */
319
    public function simplePaginate($perPage = 15, $pageName = 'page')
320
    {
321
        $page = Paginator::resolveCurrentPage($pageName);
322
        $results = $this->forPage($page, $perPage + 1)->getList();
323
324
        return new Paginator($results, $perPage, $page, [
325
            'path' => Paginator::resolveCurrentPath(),
326
            'pageName' => $pageName,
327
        ]);
328
    }
329
330
    /**
331
     * Stop the query from touching DB.