This commit is contained in:
2023-06-13 11:33:42 +07:00
parent cbc7dfdb99
commit 8f532e655f
10 changed files with 320 additions and 7 deletions

View File

@@ -13,10 +13,14 @@ class MemberController extends Controller
* Display a listing of the resource.
* @return Renderable
*/
public function index()
public function index(Request $request)
{
return Member::query()
->with('currentPlan')
->when($request->search, function ($query, $search) {
return $query->where('name', 'LIKE', '%' . $search . '%')
->orWhere('member_id', 'LIKE', '%' . $search . '%');
})
->with('currentPlan', 'currentCorporate')
->paginate();
}