ldc-mesbr-app/resources/views/bo/users/index.blade.php
2025-11-07 11:08:03 +01:00

51 lines
No EOL
1.5 KiB
PHP

@extends('layouts.main')
@section('content')
<h2>
<i class="fas fa-cogs"></i>
{{ __('Users') }}
</h2>
<div class="user-app">
<div class="heading">
<h5><i class="fas fa-users-cog"></i> {{ __('Gestion des utilisateurs') }}</h5>
<a href="{{ route('bo.users.create') }}" class="add-button"><i class="fas fa-plus-square"></i> {{ __('Ajouter') }}</a>
</div>
@if (isset($users) && count($users) > 0)
<table>
<thead>
<th>{{ __('Nom') }}</th>
<th>{{ __('Email') }}</th>
<th>{{ __('Rôle') }}</th>
<th>{{ __('Site liés') }}</th>
<th></th>
</thead>
@foreach ($users as $user)
<tr>
<td><a href="{{ route('bo.users.edit', $user) }}">{{ $user->name }}</a></td>
<td>{{ $user->email }}</td>
<td>{{ $user->roles }}</td>
<td class="sites">
@foreach ($user->sites as $site)
<p>{{ $site->site_nom }}</p>
@endforeach
</td>
@if (Auth::user()->id === $user->id)
<td></td>
@else
<td>
<form action="{{ route('bo.users.destroy', $user) }}" method="POST">
@csrf
@method('DELETE')
<button type="submit"><i class="fas fa-times"></i></button>
</form>
</td>
@endif
</tr>
@endforeach
</table>
@endif
</div>
@endsection