index.blade.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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">
  13. <div class="col-md-12">
  14. @component('product::components.message')
  15. @endcomponent
  16. @component('components.collapse-card' , ['title' => 'جست جو دسته بندی'])
  17. @slot('body')
  18. <form method="GET" action="">
  19. <div class="form-row">
  20. <div class="col">
  21. <label for="categories">{{ __(' نام دسته بندی:') }}</label>
  22. <input type="text" class="form-control" placeholder="محصول..."
  23. name="categoryName" value="{{ request()->query('categoryName') }}">
  24. </div>
  25. <div class="col">
  26. <label for="categories">{{ __(' slug:') }}</label>
  27. <input type="text" class="form-control" placeholder="دسته بندی..."
  28. name="categorySlug"
  29. value="{{ request()->query('categorySlug') }}">
  30. </div>
  31. <div class="col">
  32. <label for="categories">{{ __(' نام ثبت کننده:') }}</label>
  33. <input type="text" class="form-control" placeholder="ایجاد کننده دسته بندی..."
  34. name="productCreator_id" value="{{ request()->query('productCreator_id') }}">
  35. </div>
  36. </div>
  37. <button type="submit" class="btn btn-primary float-left btnSearch" id="show">جستجو
  38. </button>
  39. {{-- <p class="searchNaum">{{$products->count()}}{{ __(' :مورد یافت شد.') }}</p>--}}
  40. </form>
  41. <div class="mt-4">
  42. <a href="{{ route('categories.create') }}" type="button" class="btn btn-primary"><i
  43. class="fa fa-plus"></i> ایجاد دسته بندی</a>
  44. </div>
  45. @component('components.table')
  46. @slot('thead')
  47. <tr>
  48. <th>شماره دسته بندی</th>
  49. <th>نام دسته بندی</th>
  50. <th>slug</th>
  51. <th>نوع دسته بندی</th>
  52. <th> parent</th>
  53. <th>توضیحات دسته بندی</th>
  54. <th> اضافه کننده دسته بندی</th>
  55. <th> مدیریت</th>
  56. </tr>
  57. @endslot
  58. @slot('tbody')
  59. @forelse ($categories as $category)
  60. <tr>
  61. <td>
  62. {{$category->id}}
  63. </td>
  64. <td>
  65. {{$category->title}}
  66. </td>
  67. <td>
  68. {{$category->slug}}
  69. </td>
  70. <td>
  71. {{$category->category_type}}
  72. </td>
  73. <td>
  74. {{$category->parent}}
  75. </td>
  76. <td><?php echo mb_substr(strip_tags($category->discription), 0, 15, 'UTF8') . '...'?></td>
  77. <td>
  78. {{$category->user->name}}
  79. </td>
  80. <td class="d-flex">
  81. <a href="{{route('categories.edit', $category->id)}}"
  82. class="btn btn-sm btn-primary mr-2">ویرایش</a>
  83. <form
  84. action="{{route('categories.destroy', $category->id)}}"
  85. method="POST"
  86. onsubmit="return confirm('آیا مطمئن هستید؟');"
  87. >
  88. @csrf
  89. @method('DELETE')
  90. <button type="submit" class="btn btn-sm btn-danger">حذف</button>
  91. </form>
  92. </td>
  93. </tr>
  94. @empty
  95. <tr>
  96. <td colspan="5" class="text-center">موردی برای نمایش وجود ندارد.</td>
  97. </tr>
  98. @endforelse
  99. @endslot
  100. @endcomponent
  101. {{--Paginate section--}}
  102. {{ $categories->withQueryString()->links() }}
  103. @endslot
  104. @endcomponent
  105. </div>
  106. </div>
  107. @endslot
  108. @slot('script')
  109. @endslot
  110. @endcomponent