edit.blade.php 5.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. @component('panel.layouts.component', ['title' => "سطوح دسترسی، ویرایش"])
  2. @slot('style')
  3. @endslot
  4. @slot('subject')
  5. <h1><i class="fa fa-users"></i> سطوح دسترسی، ویرایش </h1>
  6. <p>از این بخش می‌توانید سطوح دسترسی کاربران را مدیریت نمایید.</p>
  7. @endslot
  8. @slot('breadcrumb')
  9. <li class="breadcrumb-item">سطوح دسترسی</li>
  10. @endslot
  11. @slot('content')
  12. <div class="row py-3">
  13. <div class="col-md-12">
  14. @component('components.collapse-card', ['title' => ''])
  15. @slot('body')
  16. <form
  17. method="POST"
  18. action="{{route('roles-assignment.update', ['roles_assignment' => $user->id, 'model' => $modelKey])}}"
  19. >
  20. @csrf
  21. @method('PUT')
  22. <div class="form-group">
  23. <label for="name"><strong>نام کاربر</strong></label>
  24. <input
  25. class="form-control"
  26. name="name"
  27. id="name"
  28. placeholder="نام کاربر"
  29. value="{{$user->name ?? 'The model doesn\'t have a `name` attribute'}}"
  30. readonly
  31. autocomplete="off"
  32. >
  33. </div>
  34. <br>
  35. <p class="mb-2"><strong>نقش‌ها</strong></p>
  36. <div class="mb-4">
  37. <div class="row">
  38. @foreach ($roles as $role)
  39. <div class="col-md-3 mb-2">
  40. <div class="custom-control custom-checkbox">
  41. <input type="checkbox"
  42. name="roles[]"
  43. value="{{$role->id}}"
  44. {!! $role->assigned ? 'checked' : '' !!}
  45. class="custom-control-input"
  46. id="{{ 'role'.$role->id }}">
  47. <label class="custom-control-label" for="{{ 'role'.$role->id }}">{{$role->name}}</label>
  48. {{-- <div class="invalid-feedback">Example invalid feedback text</div>--}}
  49. </div>
  50. </div>
  51. @endforeach
  52. </div>
  53. </div>
  54. @if ($permissions)
  55. <p class="mb-2"><strong>دسترسی‌ها</strong></p>
  56. <div class="mb-4">
  57. <div class="row">
  58. @foreach ($permissions as $permission)
  59. <div class="col-md-3 mb-2">
  60. <div class="custom-control custom-checkbox">
  61. <input type="checkbox"
  62. name="permissions[]"
  63. value="{{$permission->id}}"
  64. {!! $permission->assigned ? 'checked' : '' !!}
  65. class="custom-control-input"
  66. id="{{ 'permission'.$permission->id }}">
  67. <label class="custom-control-label" for="{{ 'permission'.$permission->id }}">{{$permission->name}}</label>
  68. {{-- <div class="invalid-feedback">Example invalid feedback text</div>--}}
  69. </div>
  70. </div>
  71. @endforeach
  72. </div>
  73. </div>
  74. @endif
  75. <div>
  76. <a
  77. href="{{route("roles-assignment.index", ['model' => $modelKey])}}"
  78. class="btn btn-sm btn-danger"
  79. >
  80. انصراف
  81. </a>
  82. <button class="btn btn-sm btn-success" type="submit">ثبت</button>
  83. </div>
  84. </form>
  85. @endslot
  86. @endcomponent
  87. </div>
  88. </div>
  89. @endslot
  90. @slot('script')
  91. @endslot
  92. @endcomponent