@php $canStatus = auth()->user()->can('changeStatus', $user); $canRoles = auth()->user()->can('assignRoles', $user); $currentRoles = old('roles', $user->roles->pluck('name')->all()); @endphp All users
@csrf @method('PUT')
Profile
Account status
@if ($canStatus) @else {{ $user->status->label() }}

You can't change the status of your own account.

@endif
Roles
@if ($canRoles) @foreach ($roles as $role) @endforeach @error('roles')
{{ $message }}
@enderror @else @foreach ($user->roles as $role){{ Str::headline($role->name) }}@endforeach

{{ auth()->user()->is($user) ? "You can't change your own roles." : 'You need the "Manage roles" permission to change roles.' }}

@endif
Two-step sign-in
@if ($user->two_factor_confirmed_at) On since {{ $user->two_factor_confirmed_at->format('d M Y') }} @if ($canStatus)

Lost their phone and recovery codes? Reset it so they can sign in with just their password and set it up again. Check who is asking first.

@endif @else Off @endif
@if ($user->two_factor_confirmed_at && $canStatus)
@csrf
@endif