input('location'); $items = explode(',', $location); if(count($items) < 2) { $lat = '39.91652'; $lng = '116.397128'; } else { $lat = $items[0]; $lng = $items[1]; } return view('admin.base.locations.index', compact('lat', 'lng', 'location')); } }