/** * Create the options for the select locations input based on type * * @Get("/selectParents", as="AdminLocationsSelectParents") * @return \Symfony\Component\HttpFoundation\Response */ public function selectParents(Request $request, Locations $locations) { $parent_type = trim($request->input('location_type')); if (!empty($parent_type)) { $options = $locations->getParents($parent_type); if (!empty($locations)) { return view('admin.locations.selectLocation', ['locations' => $options]); } else { return response(''); } } else { return response(''); } //return response()->json(); }