Esempio n. 1
0
 /**
  * Updates a component group.
  *
  * @param \CachetHQ\Cachet\Models\ComponentGroup $group
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function updateComponentGroupAction(ComponentGroup $group)
 {
     $groupData = Binput::get('group');
     $group->update($groupData);
     if (!$group->isValid()) {
         segment_track('Dashboard', ['event' => 'Edit Component Group', 'success' => false]);
         return Redirect::back()->withInput(Binput::all())->with('title', sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.components.groups.edit.failure')))->with('errors', $group->getErrors());
     }
     segment_track('Dashboard', ['event' => 'Edit Component Group', 'success' => true]);
     $successMsg = sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.components.groups.edit.success'));
     return Redirect::back()->with('success', $successMsg);
 }