Stevemo\Cpanel\User\Form\UserFormInterface::update PHP Метод

update() публичный Метод

Validate and update a existing user
Автор: Steve Montambeault
public update ( array $data ) : boolean
$data array
Результат boolean
    public function update(array $data);

Usage Example

Пример #1
0
 /**
  * Update user information
  *
  * @author Steve Montambeault
  * @link   http://stevemo.ca
  *
  * @param  int $id
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function update($id)
 {
     try {
         $credentials = Input::except('groups');
         $credentials['groups'] = Input::get('groups', array());
         $credentials['id'] = $id;
         if ($this->userForm->update($credentials)) {
             return Redirect::route('cpanel.users.index')->with('success', Lang::get('cpanel::users.update_success'));
         }
         return Redirect::back()->withInput()->withErrors($this->userForm->getErrors());
     } catch (UserNotFoundException $e) {
         return Redirect::route('cpanel.users.index')->with('error', $e->getMessage());
     }
 }