/** * Show the form for creating a new mapaslugares. * * @return Response */ public function create() { $paises = Pais::lists('nombre', 'id'); $departamentos = Departamento::lists('nombre', 'id'); $municipios = Municipio::lists('nombre', 'id'); return view('mapaslugares.create', compact('paises', 'departamentos', 'municipios')); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $paises = Pais::lists('nombre', 'id'); $departamentos = Departamento::lists('nombre', 'id'); $municipios = Municipio::lists('nombre', 'id'); $anuncios = Anuncio::all(); return view('mapas', compact('paises', 'departamentos', 'municipios', 'anuncios')); }
/** * Show the form for creating a new Departamento. * * @return Response */ public function create() { $paises = Pais::lists('nombre', 'id'); return view('departamentos.create', compact('paises')); }
/** * Show the form for editing the specified anuncio. * * @param int $id * @return Response */ public function edit($id) { $paises = Pais::lists('nombre', 'id'); $departamentos = Departamento::lists('nombre', 'id'); $municipios = Municipio::lists('nombre', 'id'); $categoria = Categoria::lists('nombre', 'id'); $mapas = Mapaslugares::lists('nombre', 'id'); $anuncio = $this->anuncioRepository->findanuncioById($id); if (empty($anuncio)) { Flash::error('anuncio not found'); return redirect(route('anuncios.index')); } return view('anuncios.edit')->with('anuncio', $anuncio, 'paises', 'departamentos', 'municipios', 'categoria', 'mapas'); }