Here is my code:
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Input;
use Illuminate\Pagination\Paginator;
.
.
$collection = new Collection($guarantee_ticket);
// Paginate
$perPage = 3;
$currentPage = Input::get('page') - 1; // url.com/test?page=2
$pagedData = $collection->slice($currentPage * $perPage, $perPage)->all();
$pagination= Paginator::make($pagedData, count($collection), $perPage);
It throws:
Call to undefined method Illuminate\Pagination\Paginator::make()
And when I replace use Illuminate\Support\Facades\Paginator;
with use Illuminate\Pagination\Paginator;
, then it throws:
Class 'Illuminate\Support\Facades\Paginator' not found
Any idea how can I fix it?