I have query with laravel which returns my results and paginate() at the end, problem is when i foreach it to collect all ids in array i get first page only.
Is there a way to get those before paginate so i dont have to run the query twice?
$clients = Client::apply($data, $dataArray)->ModelJoinCall()->orderBy($this->sortby, $this->orderby)->paginate(30);