82 lines
4.4 KiB
PHP
82 lines
4.4 KiB
PHP
@php($title = 'Пользователи')
|
||
@extends('layouts.admin')
|
||
@section('content')
|
||
<div>
|
||
@if ($users->count() == 0)
|
||
<div class="text-center py-5">Нет данных для отображения</div>
|
||
@else
|
||
<form class="d-flex mb-3" method="GET" action="{{ route('admin.users') }}">
|
||
<div class="p-2 border rounded-3 border-1 bg-white">
|
||
<input type="radio" class="btn-check" name="role" value="all" id="option_all" autocomplete="off"
|
||
onclick="this.form.submit()" {{ $role == 'all' || !$role ? 'checked' : '' }}>
|
||
<label class="btn p-2 fs-5" for="option_all">Все</label>
|
||
@foreach ($roles as $roleItem)
|
||
<input type="radio" class="btn-check" name="role" value="{{ $roleItem->id }}"
|
||
id="option_{{ $roleItem->id }}" autocomplete="off" onclick="this.form.submit()"
|
||
{{ $roleItem->id == $role ? 'checked' : '' }}>
|
||
<label class="btn p-2 fs-5" for="option_{{ $roleItem->id }}">{{ __($roleItem->name) }}</label>
|
||
@endforeach
|
||
</div>
|
||
|
||
<div class="ms-auto p-2">
|
||
<!--<button type="button" class="btn btn-primary py-2 px-3 fs-5" data-bs-toggle="modal"
|
||
data-bs-target="#createAgentModal">
|
||
<i class="bi bi-person-plus"></i>
|
||
</button>-->
|
||
</div>
|
||
</form>
|
||
|
||
<div class="fs-5 bg-light p-0 m-0 border border-1 rounded-4 py-3">
|
||
<table class="table m-0">
|
||
<thead>
|
||
<tr scope="col">
|
||
<th>ФИО
|
||
<th>Email
|
||
<th>Телефон
|
||
<th>Создан
|
||
<th>
|
||
</tr>
|
||
</thead>
|
||
<tbody class=" ">
|
||
@foreach ($users as $user)
|
||
<tr scope="row">
|
||
<td class="align-middle">
|
||
{{ $user->name }}
|
||
</td>
|
||
<td class="align-middle">
|
||
{{ $user->email }}
|
||
</td>
|
||
<td class="align-middle">
|
||
{{ $user->phone }}
|
||
</td>
|
||
<td class="align-middle">
|
||
{{ $user->created_at->diffForHumans() }}
|
||
</td>
|
||
<td>
|
||
<div class="dropdown" style="">
|
||
<button class="btn btn-light" type="button" id="dropdownMenuButton"
|
||
data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||
<i class="bi bi-three-dots-vertical"></i>
|
||
</button>
|
||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||
<a class="dropdown-item"
|
||
href="{{ route('admin.users.edit', ['user' => $user]) }}">Редактировать</a>
|
||
<form method="post"
|
||
action="{{ route('admin.posts.delete', ['post' => $user]) }}">
|
||
@csrf
|
||
<button class="dropdown-item" type="submit">Удалить</button>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
@endforeach
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
@endif
|
||
@livewire('post.card')
|
||
</div>
|
||
|
||
@endsection
|