📌  相关文章
📜  带有搜索过滤器的 laravel 分页 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:44.680000             🧑  作者: Mango

代码示例1
// if $id has value it will include "where('id','<',$id) else will return all"
$wells = DB::table('well_s')
        ->when($id, function ($query, $id) {
            return $query->where('id','<',$id);
        })
        ->paginate(20);