I using third party. I get from here : https://github.com/andersao/l5-repository
My function in file repository is like this :
public function displayList($year, $id = NULL)
{
$clauses = ['year' => $year];
if(isset($id)) {
$clauses = array_merge($clauses, ['id' => $id]);
}
$query = Self::orderBy('programcode')
->orderBy('accountcode')
->findWhere($clauses)
->paginate(1);
return $query;
}
When executed, there exist error like this : Method paginate does not exist..
I try remove ->findWhere($clauses). It works. No error.
Findwhere and paginate apparently can not run simultaneously
Is there a solution to this problem?