Feat: Searchable Select для групп пользователя

 TomSelect с мультивыбором (теги как в WordPress)
 API /api/groups/search для поиска групп
 Обновлён edit.blade.php пользователя
 Обновлён show.blade.php пользователя
 Компонент поддерживает multiple=true

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
mirivlad
2026-03-30 12:07:07 +08:00
co-authored by Qwen-Coder
parent 7782c59f5b
commit 1f99664d19
6 changed files with 71 additions and 79 deletions
+1 -17
View File
@@ -91,24 +91,8 @@ class UserController extends Controller
Gate::authorize('view', $user);
$user->load(['organization', 'roles', 'groups']);
// Получаем доступные группы для пользователя
if ($user->organization_id) {
$availableGroups = Group::whereNull('organization_id')
->orWhere('organization_id', $user->organization_id)
->whereDoesntHave('users', function($q) use ($user) {
$q->where('users.id', $user->id);
})
->get();
} else {
$availableGroups = Group::whereNull('organization_id')
->whereDoesntHave('users', function($q) use ($user) {
$q->where('users.id', $user->id);
})
->get();
}
return view('admin.users.show', compact('user', 'availableGroups'));
return view('admin.users.show', compact('user'));
}
public function edit(User $user)