Пример #1
0
 /**
  * Display a listing of eventos
  *
  * @return Response
  */
 public function getIndex()
 {
     $eventos = EventoEspecial::with('pais')->Where('publicado', '=', 1);
     if (Input::has('pais')) {
         $string = Input::get('pais');
         $pais = Pais::Where('name', 'LIKE', "%{$string}%")->first();
         $eventos = $eventos->Where('pais_id', '=', $pais->id);
     }
     if (Input::has('tipo')) {
         $eventos = $eventos->Where('tipo', '=', Input::get('tipo'));
     }
     $count = $eventos->count();
     $eventos = $eventos->paginate(5);
     $eventos = $this->removeHtmlDescricao($eventos);
     $pais = Pais::all();
     foreach ($pais as $pais) {
         $json[] = $pais->name;
     }
     $json = json_encode($json);
     return View::make('eventoespecial.index', compact('eventos', 'count', 'json'));
 }
 /**
  * Show the form for editing the specified pacote.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $evento = EventoEspecial::with('hoteis', 'apartamentos', 'passeios', 'servicosnoturnos')->find($id);
     $paises = Pais::lists("name", "id");
     $hoteis = Hotel::with('pais')->get();
     $apartamentos = Apartamento::with('pais')->get();
     $passeios = Passeio::with('pais')->get();
     $servicosnoturnos = ServicoNoturno::with('pais')->get();
     return View::make('admin.eventoespecial.edit', compact('evento', 'paises', 'hoteis', 'apartamentos', 'passeios', 'servicosnoturnos'));
 }