I make fluent request with distinct and paginate. My problem is that the paginate request is execute before disinct request
My Fluent request :
$candidat
Blind guess : try
DB::table('candidates')->...stuff...->get()->paginate(15)
Real answer: Create your paginator manually:
$candidates = DB::table('candidates')->...stuff...->get();
$paginator = Paginator::make($candidates, count($candidates), 15);
<?php
$presenter = new Illuminate\Pagination\BootstrapPresenter($candidates);
$presenter->setLastPage($totalPages);
?>
@if ($totalPages> 1)
<ul class="pagination">
{{ $presenter->render() }}
</ul>
@endif