In new versions of Laravel, you can create your own paginate. Source: https://laravel.com/docs/9.x/pagination
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Collection;
/**
* @param Collection $collection
* @param int $perPage