{{ Form::open(['route' => 'Admin.Shop.Producers.store', 'id' => 'producer-form', 'autocomplete' => 'off', 'files' => true]) }}
<input type="hidden" name="id" id="id" value="{{ $producer['id'] ?? false }}">

<div class="row">
    <div class="col-md-8">
        <div class="row mb-3">
            <div class="col-6">
                @include('components.form.input', [
                    'name' => 'name',
                    'value' => $producer['name'] ?? null,
                    'required' => true,
                    'label' => 'Nom',
                ])
            </div>
            <div class="col-6">
                @include('components.form.input', [
                    'name' => 'alias',
                    'value' => $producer['alias'] ?? null,
                    'required' => true,
                    'label' => 'Alias',
                ])
            </div>
        </div>

        <div class="row mb-3">
            <div class="col-12">
                @include('components.form.selects.select-tree', [
                    'name' => 'tags[]',
                    'list' => $tags_list,
                    'values' => $producer['tags'] ?? null,
                    'class' => 'select2 form-control',
                    'multiple' => true,
                    'label' => 'Tags',
                ])
            </div>
        </div>

        <div class="row mb-3">
            <div class="col-12">
                @include('components.form.textarea', [
                    'name' => 'description',
                    'value' => $producer['description'] ?? null,
                    'class' => 'editor',
                    'rows' => 5,
                    'required' => false,
                    'label' => 'Description',
                ])
            </div>
        </div>

    </div>

    <div class="col-md-4">
        @include('components.uploader.widget', [
            'load_url' => route('Admin.Shop.Merchandises.getImages', ['id' => $producer['id'] ?? false]),
            'delete_url' => route('Admin.Botanic.Varieties.deleteImage'),
            'name' => 'images',
        ])
    </div>

</div>
{{ form::close() }}

<x-save />

@include('load.form.appender')
@include('load.form.editor')
@include('load.form.save')
@include('load.form.select2')
@include('load.layout.chevron')
@include('boilerplate::load.fileinput')
@include('boilerplate::load.tinymce')

@push('js')
    {!! JsValidator::formRequest('App\Http\Requests\Admin\Shop\StoreProducerPost', '#producer-form') !!}

    <script>
        $(function() {
            initSelect2();
            initChevron();
            initEditor();
            initSaveForm('producer-form');
        });
    </script>
@endpush
