{{-- resources/views/admin/users/edit.blade.php --}} @php /** File: resources/views/admin/users/edit.blade.php */ // Fallback si la variable n'a pas été passée par le contrôleur if (!isset($selectedSocietyIds)) { try { $selectedSocietyIds = isset($editedUser) ? $editedUser->societies()->pluck('societydb.id')->toArray() : []; } catch (\Throwable $e) { $selectedSocietyIds = []; } } // S'assurer que c'est bien un array if ($selectedSocietyIds instanceof \Illuminate\Support\Collection) { $selectedSocietyIds = $selectedSocietyIds->toArray(); } echo $editedUser->id; @endphp @extends('layouts.base') @section('title', 'Admin · ' . __('Edit user')) @section('content') {{-- --}}
@if(session('ok'))
{{ session('ok') }}
@endif @if($errors->any())
{{ __('Please correct the errors below') }}
@endif

{{ __('Back') }} {{ __('Edit user') }} #{{ $editedUser->id }} {{ $editedUser->name }}

@csrf @method('PUT') {{-- Carte principale --}}
{{-- Colonne gauche : infos compte --}}

{{ __('Account') }}

{{-- Blocked --}} @if($editedUser->blocked)
{{ __('Blocked since') }}: {{ optional($editedUser->blocked)->format('Y-m-d H:i') }}
@endif
{{ __('Email can be changed; verification may be required.') }}
{{-- Colonne droite : avatar / rôle / sociétés --}}
{{-- Avatar --}}

{{ __('Profile picture') }}

@if($editedUser->photo) Avatar @else
{{ __('No photo') }}
@endif
{{ __('PNG/JPG up to 2 MB') }}

{{-- Rôle (existant) --}} @error('role_id')
{{ $message }}
@enderror {{-- Sociétés (multi) --}} @php $societies = $societies ?? collect(); $selectedSocietyIds = $selectedSocietyIds ?? []; @endphp @if($societies->isEmpty())
(Aucune société disponible)
@else {{-- --}}
Maintenir Ctrl/⌘ pour multi-sélection.
@endif
{{ __('Cancel') }}
@endsection