index.blade.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. @extends('layouts.app')
  2. @section('content')
  3. <div class="row mb-3">
  4. <div class="col-6">
  5. <h3>Пользователи</h3>
  6. </div>
  7. <div class="col-6 text-end">
  8. <button type="button" class="btn btn-sm btn-primary" data-bs-toggle="modal" data-bs-target="#addModal">
  9. Добавить
  10. </button>
  11. </div>
  12. </div>
  13. @include('partials.table', [
  14. 'id' => $id,
  15. 'header' => $header,
  16. 'strings' => $users,
  17. 'routeName' => 'user.show',
  18. 'routeParam' => 'user',
  19. ])
  20. @include('partials.pagination', ['items' => $users])
  21. <!-- Модальное окно добавления-->
  22. <div class="modal fade" id="addModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
  23. <div class="modal-dialog modal-fullscreen-sm-down modal-lg">
  24. <div class="modal-content">
  25. <div class="modal-header">
  26. <h1 class="modal-title fs-5" id="addModalLabel">Добавить заказ МАФ</h1>
  27. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
  28. </div>
  29. <div class="modal-body">
  30. <form action="{{ route('user.store') }}" method="post">
  31. @csrf
  32. @include('partials.input', ['name' => 'email', 'type' => 'text', 'title' => 'Логин/email', 'required' => true])
  33. @include('partials.input', ['name' => 'name', 'title' => 'Имя', 'required' => true])
  34. @include('partials.input', ['name' => 'phone', 'title' => 'Телефон'])
  35. @include('partials.input', ['name' => 'password', 'type' => 'password', 'title' => 'Пароль', 'required' => true])
  36. @include('partials.select', ['name' => 'role', 'title' => 'Роль', 'options' => getRoles(), 'value' => $user->role ?? \App\Models\Role::MANAGER])
  37. @include('partials.submit', ['name' => 'Добавить'])
  38. </form>
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. @if($errors->any())
  44. @dump($errors)
  45. @endif
  46. @endsection