/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { $location = Location::findOrFail($id); $weathers = Weather::get($location->name); $hospitals = Hospital::where('address', 'LIKE', "%{$location->name}%")->get(); $request = ['weathers' => $weathers, 'hospitals' => $hospitals]; return json_encode($request); }