/** * Update a group from form request * * @param Group $group * @param Request $request * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector */ public function update(Group $group, Request $request) { $this->authorize('edit_users'); $this->validate($request, ['name' => 'required|string|between:3,50', 'description' => 'string|between:0,100', 'permission_list' => 'array']); $group->update($request->all()); $permission_list = $request->input('permission_list') ?: []; $group->permissions()->sync($permission_list); flash()->success('Group Saved', 'The group has been updated'); return redirect('group'); }