Stevemo\Cpanel\Group\Form\GroupFormInterface::update PHP Метод

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

Update a group
Автор: Steve Montambeault
public update ( array $data ) : Bool
$data array
Результат Bool
    public function update(array $data);

Usage Example

Пример #1
0
 /**
  * Update the specified resource in storage.
  *
  * @author Steve Montambeault
  * @link   http://stevemo.ca
  *
  * @param $id
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function update($id)
 {
     try {
         $inputs = Input::all();
         $inputs['id'] = $id;
         if ($this->form->update($inputs)) {
             return Redirect::route('cpanel.groups.index')->with('success', Lang::get('cpanel::groups.update_success'));
         }
         return Redirect::back()->withInput()->withErrors($this->form->getErrors());
     } catch (GroupNotFoundException $e) {
         return Redirect::route('cpanel.groups.index')->with('error', $e->getMessage());
     }
 }