Okay, this is my CustomSimplePagination class, stored in app/Library/Pagination:
<?php namespace App\Library\Pagination;
use Illuminate\Pagination\SimpleBootstrapThreePresenter ;
class CustomSimplePagination extends SimpleBootstrapThreePresenter
{
public function __construct(PaginatorContract $paginator)
{
$this->paginator = $paginator;
}
public function hasPages()
{
return $this->paginator->hasPages() && count($this->paginator->items()) > 0;
}
public function render()
{
if ($this->hasPages())
{
return sprintf(
'<ul class="pager">%s %s</ul>',
$this->getPreviousButton("test1"),
$this->getNextButton("test2")
);
}
return '';
}
}
On my controller, I added:
use App\Library\Pagination\CustomSimplePagination;
Then, on my method, I added:
$customPaginationPresenter = new CustomSimplePagination;
And, I sent that variable to the view and used it like so:
{!! $colleagues->appends(Request::except('page'))->render($customPaginationPresenter) !!}
All of this should work fine, but when I go to my route, I get this error:
ErrorException in CustomSimplePagination.php line 13:
Argument 1 passed to App\Library\Pagination\CustomSimplePagination::__construct() must be an instance of App\Library\Pagination\PaginatorContract, none given, called in C:\www\htdocs\social\app\Http\Controllers\ProfileController.php on line 33 and defined