/**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $districts_data = District::lists("name", "id");
     $municipality = Municipality::find($id);
     if (is_null($municipality)) {
         return Redirect::route('admin.municipalities.index')->withErrors(array('mainError' => 'Общината не е намерена.'));
     } else {
         return View::make('admin.municipality.edit')->with('municipality', $municipality)->with('districts_data', $districts_data);
     }
 }
Exemplo n.º 2
0
 public function check_region1($id)
 {
     if ($id == "all") {
         return Form::select('district', array('all' => 'all') + District::lists('district', 'id'), '', array('class' => 'form-control', 'required' => 'requiered'));
     } else {
         return Form::select('district', array('all' => 'all') + Region::find($id)->district()->lists('district', 'id'), '', array('class' => 'form-control', 'required' => 'requiered'));
     }
 }