Fix: Удалён дубликат метода update()

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
mirivlad 2026-03-31 15:05:58 +08:00
parent 640a20ea4e
commit b456b9c589
1 changed files with 0 additions and 23 deletions

View File

@ -98,29 +98,6 @@ class GroupUserController extends Controller
return view('admin.groups.show', compact('group', 'users')); return view('admin.groups.show', compact('group', 'users'));
} }
public function update(Request $request, Group $group)
{
Gate::authorize('update', $group);
$validated = $request->validate([
'name' => 'required|string|max:255',
'description' => 'nullable|string',
'is_active' => 'boolean',
'users' => 'nullable|array',
'users.*' => 'exists:users,id',
]);
$group->update($validated);
// Синхронизируем пользователей в группе
if (isset($validated['users'])) {
$group->users()->sync($validated['users']);
}
return redirect()->route('admin.groups.show', $group)
->with('success', 'Группа успешно обновлена.');
}
public function destroy(Group $group) public function destroy(Group $group)
{ {
Gate::authorize('delete', $group); Gate::authorize('delete', $group);