function search($email) { $user = Order::where('email_id', $email)->first(); if (!empty($user)) { $orderitem = new Orderitem(); $data = $orderitem->getOrderbyemail($email); } else { $data['message'] = "no data found"; } return Response::json($data, 400); }