create.blade.php 7.6 KB

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