@component('panel.layouts.component', ['title' => 'ثبت دسته جدید'])

    @slot('style')
        <style>
            .card-header {
                text-align: center !important;
            }

            .form-control {

                background-color: hsl(315, 22%, 86%);
            }

            .required {
                color: red;
            }

            .py-5 {
                padding-top: 0 !important;
            }
        </style>
    @endslot
    @slot('subject')
        <h1><i class="fa fa-users"></i> ثبت دسته جدید </h1>

    @endslot
    @slot('breadcrumb')
        <li class="breadcrumb-item">دسته بندی محصولات</li>
    @endslot

    @slot('content')
        <div class="auth-background h-auto py-5">
            <div class="container py-5">
                <div class="row align-items-center">
                    <div class="col-lg-11 col-md-11 mx-auto">
                        <div class="card">
                            <div class="card-header"><strong>{{ __('ثبت دسته بندی جدید') }}</strong></div>

                            <div class="card-body mx-lg-5 px-lg-3">
                                <form method="POST" action="{{ route('categories.store') }}">
                                    @csrf

                                    <div class="form-group">
                                        <label for="title">{{ __('نام دسته ') }}</label><i class="required">&nbsp; *</i>
                                        <input id="title" type="text"
                                               class="form-control @error('title') is-invalid @enderror" name="title"
                                               value="{{ old('title') }}"  autocomplete="title" autofocus>

                                        @error('title')
                                        <span class="invalid-feedback" role="alert">
                                            <strong>{{ $message }}</strong>
                                        </span>
                                        @enderror

                                    </div>

                                    <div class="form-group">
                                        <label for="slug">  {{ __('slug  ') }}</label>
                                        <input id="slug" type="text"
                                               class="form-control @error('slug') is-invalid @enderror"
                                               name="slug" value="{{ old('slug') }}"
                                               autocomplete="slug" autofocus>

                                        @error('slug')
                                        <span class="invalid-feedback" role="alert">
                                            <strong>{{ $message }}</strong>
                                        </span>
                                        @enderror

                                    </div>
                                    <div class="form-group">
                                        <label for="parent">  {{ __('parent  ') }}</label><i class="required">&nbsp;*</i>
                                        <input id="parent" type="text"
                                               class="form-control @error('parent') is-invalid @enderror"
                                               name="parent" value="{{ old('parent') }}"
                                               autocomplete="parent" autofocus>

                                        @error('parent')
                                        <span class="invalid-feedback" role="alert">
                                            <strong>{{ $message }}</strong>
                                        </span>
                                        @enderror

                                    </div>

                                    <div class="form-group">
                                        <label for="category_type">{{ __(' نوع دسته ') }}</label><i class="required">&nbsp;
                                            *</i>
                                        <select id="category_type" type="text"
                                                class="form-control @error('category_type') is-invalid @enderror"
                                                name="category_type"
                                                required autocomplete="category_type">
                                            <option value="1">محصولات</option>
                                            <option value="0">اخبار</option>
                                            <option value="0">دسته بندی</option>
                                        </select>

                                        @error('category_type')
                                        <span class="invalid-feedback" role="alert">
                                            <strong>{{ $message }}</strong>
                                        </span>
                                        @enderror
                                    </div>


                                    <div class="form-group">
                                        <label for="discription">{{ __(' توضیحات دسته ') }}</label><i class="required">&nbsp; *</i>
                                        <textarea id="discription" type="text"
                                                  class="form-control @error('discription') is-invalid @enderror"
                                                  name="discription"
                                                  autocomplete="discription">{{ old('discription') }}</textarea>

                                        @error('discription')
                                        <span class="invalid-feedback" role="alert">
                                            <strong>{{ $message }}</strong>
                                        </span>
                                        @enderror
                                    </div>
                                    <div class="form-group mb-0">
                                        <div class="">
                                            <button type="submit" class="btn btn-primary">
                                                {{ __('ثبت دسته بندی') }}
                                            </button>

                                            <a href={{ route('categories.index') }} type="button"
                                               class="btn btn-warning">
                                                انصراف</a>

                                        </div>
                                    </div>
                                </form>
                            </div>
                            <div class="card-footer">

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    @endslot

    @slot('script')

    @endslot

@endcomponent

