@php use App\Models\Role; $user = $user ?? null; $selectedProjects = old('project_ids', $user ? $user->projects->pluck('id')->toArray() : []); $selectedClientIds = old('client_ids', $user ? ($user->relationLoaded('clients') && $user->clients->isNotEmpty() ? $user->clients->pluck('id')->toArray() : ($user->client_id ? [$user->client_id] : [])) : []); $selectedRoleId = old('role_id', $user?->role_id); $showClientSelect = auth()->user()->isSuperAdmin() || auth()->user()->isClientAdmin(); $clientsData = $clients->map(fn ($c) => ['id' => $c->id, 'name' => $c->company_name])->values(); $projectsData = $projects->map(fn ($p) => [ 'id' => $p->id, 'name' => $p->name, 'client_id' => $p->client_id, ])->values(); $roleSlugs = $roles->pluck('slug', 'id'); @endphp
@if($isEdit ?? false)
Leave blank to keep current password
@else
@endif
@if($showClientSelect)
User can access data for all selected clients (e.g. Dsignxt and Koko).
@endif
Click to add projects for this user.
@push('styles') @endpush @push('scripts') @endpush