public function edit($entity) { if (\Request::input('password') != null) { $new_input = array('password' => \Hash::make(\Request::input('password'))); \Request::merge($new_input); } parent::edit($entity); $this->edit = \DataEdit::source(new Admin()); $this->edit->label('Edit Admin'); $this->edit->link("rapyd-demo/filter", "Articles", "TR")->back(); $this->edit->add('email', 'Email', 'text')->rule('required|min:5'); $this->edit->add('first_name', 'firstname', 'text'); $this->edit->add('last_name', 'lastname', 'text'); $this->edit->add('password', 'password', 'password')->rule('required'); $this->edit->add('roles', 'Roles', 'checkboxgroup')->options(Role::pluck('name', 'id')->all()); return $this->returnEditView(); }