Esempio n. 1
0
 public function create()
 {
     $area = Area::lists('name', 'id');
     $typeOfProperty = TypeOfProperty::lists('type', 'id');
     $numberOfRooms = NumberOfRooms::lists('number', 'id');
     $city = City::lists('city', 'id');
     return view('announcements.create', compact('area', 'typeOfProperty', 'numberOfRooms', 'city'));
 }
 public function edit($entity)
 {
     parent::edit($entity);
     $this->edit = \DataEdit::source(new \App\People());
     $this->edit->label('Persona');
     $this->edit->text('nombre', 'Nombre')->rule('required');
     $this->edit->add('area_id', 'Area', 'select')->rule('required')->options(\App\Area::lists('nombre', 'id')->all());
     $this->edit->checkbox('destacado', 'Destacado');
     $this->edit->text('sueldo', 'Sueldo ($)')->rule('required');
     $this->edit->text('aporte', 'Aporte ($)')->rule('required');
     $this->edit->add('foto', 'Foto', 'image')->move('media/fotos/')->preview(80, 80);
     return $this->returnEditView();
 }