ldc-legaulois/resources/views/bo/users/index.blade.php
2021-04-12 10:01:48 +02:00

41 lines
1.4 KiB
PHP

@extends('layouts.bo')
@section('content')
<div class="card">
<div class="card-header">
Utilisateurs
<a href="{{route('bo.users.create')}}" class="btn btn-sm btn-primary float-right">Ajouter</a>
</div>
<div class="card-body">
{{ $users->withQueryString()->links() }}
<table class="table">
<thead class="thead-dark">
<tr>
<th scope="col">Prénom</th>
<th scope="col">Nom</th>
<th scope="col">Email</th>
<th scope="col">Rôle</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
@foreach($users as $user)
<tr>
<th>{{$user->firstname}}</th>
<td>{{$user->lastname}}</td>
<td>{{$user->email}}</td>
@if ($user->role === 1)
<td>Super-Administrateur</td>
@elseif($user->role === 2)
<td>Administrateur</td>
@endif
<td><a href="{{route('bo.users.edit', ['user' => $user->id])}}" class="btn btn-sm btn-primary">Éditer</a></td>
</tr>
@endforeach
</tbody>
</table>
{{ $users->withQueryString()->links() }}
</div>
</div>
@endsection