私はサードパーティを使用しています。私はここから入手:paginateとfindwhereを同じように使うには? (laravel 5.3)
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;
}
実行すると、このようなエラーが存在する:Method paginate does not exist.
ファイルリポジトリ内https://github.com/andersao/l5-repository
My機能は、このようなものです。
私は->findWhere($clauses)
を削除してみます。できます。エラーはありません。
Findwhereと明らかにページ付けは、この問題に対する解決策はあり同時に
を実行することはできませんか?
は何の解決策続行しますか?ドキュメントには ' - > paginate(...)'があります。ここを見てください:https://github.com/andersao/l5-repository –
@mosestoh私は解決策を見つけたと確信しています。答えを更新しました。 – devk
エラーがあります: 'メンバー関数への呼び出しpaginate()on null' –