edit.blade.php 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. @component('panel.layouts.component', ['title' => 'ویرایش دسته جدید'])
  2. @slot('style')
  3. @endslot
  4. @slot('subject')
  5. <h1><i class="fa fa-users"></i> ویرایش دسته بندی </h1>
  6. @endslot
  7. {{-- @slot('breadcrumb')--}}
  8. {{-- <a href=""><li class="breadcrumb-item"> دسته بندی / </li></a>--}}
  9. {{-- <a href=""><li class="breadcrumb-item">&nbsp; ویرایش دسته بندی/ </li></a>--}}
  10. {{-- <li class="breadcrumb-item">&nbsp; {{$category->title}} </li>--}}
  11. {{-- @endslot--}}
  12. @slot('breadcrumb')
  13. <li class="breadcrumb-item"> {{$category->title}} </li>
  14. <li class="breadcrumb-item">&nbsp; ویرایش دسته بندی&nbsp;/ </li>
  15. <a href="{{ route('categories.index') }}" ><li class="breadcrumb-item"> &nbsp;دسته بندی </li></a>
  16. @endslot
  17. @slot('content')
  18. <div class="auth-background h-auto py-5">
  19. <div class="py-5">
  20. <div class="row align-items-center">
  21. <div class="col-lg-12 col-md-12 mx-auto">
  22. <div class="card">
  23. <div class="card-header"><strong>{{ __('ویرایش دسته بندی ') }}</strong></div>
  24. <div class="card-body mx-lg-6 px-lg-4">
  25. @component('product::components.message')
  26. @endcomponent
  27. <form method="POST" action="{{ route('categories.update',$category->id) }}">
  28. @csrf
  29. @if ($category)
  30. @method('PUT')
  31. @endif
  32. <div class="form-group">
  33. <label for="title">{{ __('category.title') }}</label><i class="required">&nbsp; *</i>
  34. <input id="title" type="text"
  35. class="form-control @error('title') is-invalid @enderror" name="title"
  36. value="{{$category->title}}" autocomplete="title" autofocus>
  37. @error('title')
  38. <span class="invalid-feedback" role="alert">
  39. <strong>{{ $message }}</strong>
  40. </span>
  41. @enderror
  42. </div>
  43. <div class="form-row">
  44. <div class="form-group col-lg-4">
  45. <label for="slug">{{ __('category.slug') }}</label>
  46. <input id="slug" type="text"
  47. class="form-control @error('slug') is-invalid @enderror"
  48. name="slug" value="{{$category->slug}}"
  49. autocomplete="slug" autofocus>
  50. @error('slug')
  51. <span class="invalid-feedback" role="alert">
  52. <strong>{{ $message }}</strong>
  53. </span>
  54. @enderror
  55. </div>
  56. <div class="col-lg-4">
  57. <label>دسته بندی والد:</label>
  58. <select name="parent_id"
  59. class="form-control select2 @error('parent_id') is-invalid @enderror" >
  60. <option value="0">--</option>
  61. {!! category_select_options( $categories, $category->parent_id ) !!}
  62. </select>
  63. @error('parent_id')
  64. <span class="invalid-feedback" role="alert">
  65. <strong>{{ $message }}</strong>
  66. </span>
  67. @enderror
  68. </div>
  69. <div class="form-group col-lg-4">
  70. <label for="category_type">{{ __('category.category_type') }}</label><i class="required">&nbsp; *</i>
  71. <select id="category_type" type="text"
  72. class="form-control @error('category_type') is-invalid @enderror"
  73. name="category_type"
  74. autocomplete="category_type">
  75. <option value="">انتخاب کنید</option>
  76. <option value="0" @if ($category->category_type === 'محصولات') selected='selected'@endif>محصولات</option>
  77. <option value="1" @if ($category->category_type === 'اخبار') selected='selected'@endif>اخبار</option>
  78. <option value="2" @if ($category->category_type === 'مطالب') selected='selected'@endif>مطالب</option>
  79. </select>
  80. @error('category_type')
  81. <span class="invalid-feedback" role="alert">
  82. <strong>{{ $message }}</strong>
  83. </span>
  84. @enderror
  85. </div>
  86. </div>
  87. <div class="form-group">
  88. <label for="discription">{{ __('category.discription') }}</label><i class="required">&nbsp; *</i>
  89. <textarea id="discription" type="text"
  90. class="form-control editor @error('discription') is-invalid @enderror"
  91. name="discription"
  92. autocomplete="discription">{{$category->discription}}</textarea>
  93. @error('discription')
  94. <span class="invalid-feedback" role="alert">
  95. <strong>{{ $message }}</strong>
  96. </span>
  97. @enderror
  98. </div>
  99. <div class="form-group mb-0">
  100. <div class="">
  101. <button type="submit" class="btn btn-primary">
  102. {{ __('ویرایش دسته بندی') }}
  103. </button>
  104. <a href={{ route('categories.index') }} type="button"
  105. class="btn btn-warning">
  106. انصراف</a>
  107. </div>
  108. </div>
  109. </form>
  110. </div>
  111. <div class="card-footer">
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. @endslot
  119. @slot('script')
  120. @endslot
  121. @endcomponent