public function search(Request $request){
$search=array();
$new_customer=New_Customer_M::orderByDesc(‘id’)->where(‘first_name’,’like’,’%’.$request->search.’%’)->get();
foreach($new_customer as $cutomer_name){
$search[]=array(
‘first_name’=>$new_customer,
);
}
return response()->json($search);
}
this is code for fecth data from database but how we write code in ajax to all disaply rows that are matching with all json data