/** * @param $id * @param $input * @throws GeneralException * @return mixed */ public function update($id, $input) { $group = $this->find($id); //Name is changing for whatever reason if ($group->name != $input['name']) { if (PermissionGroup::where('name', $input['name'])->count()) { throw new GeneralException(trans('exceptions.backend.access.permissions.groups.name_taken')); } } return $group->update($input); }
/** * @param $id * @param $input * * @throws GeneralException * * @return mixed */ public function update($id, $input) { $group = $this->find($id); //Name is changing for whatever reason if ($group->name != $input['name']) { if (PermissionGroup::where('name', $input['name'])->count()) { throw new GeneralException('There is already a group with that name'); } } return $group->update($input); }