public function saveRectangleToDatabase(Request $request) { $id = $request->input('id'); $NElng = $request->input('NElng'); $type = $request->input('type'); $SWlat = $request->input('SWlat'); $NElat = $request->input('NELat'); $SWlng = $request->input('SWlng'); if ($type === 'rec') { $result = Venue::addRectangle($NElat, $NElng, $SWlat, $SWlng, $type, $id); } if ($result) { return response()->json(array('status' => 1, 'message' => 'Success')); } return response()->json(array('status' => 0, 'message' => 'Error !!')); }