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

<div class="row mb-3">
    <div class="col-6">
        <div class="row">
            <div class="col-6">
                @include('components.form.select', [
                    'name' => 'package_id',
                    'list' => $packages ?? [],
                    'value' => $variation['package_id'] ?? false,
                    'required' => true,
                    'with_empty' => '',
                    'label' => 'Package',
                ])
            </div>
            <div class="col-2">
                @include('components.form.input', [
                    'name' => 'quantity',
                    'value' => $variation['quantity'] ?? false,
                    'required' => true,
                    'label' => 'Quantité',
                ])
            </div>
            <div class="col-4">
                @include('components.form.select', [
                    'name' => 'unity_id',
                    'list' => $unities ?? [],
                    'value' => $variation['unity_id'] ?? false,
                    'required' => true,
                    'with_empty' => '',
                    'label' => 'Unité',
                ])
            </div>
        </div>
    </div>
</div>

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

<x-save />>

@include('load.form.editor')
@include('load.form.save')

@push('js')
    {!! JsValidator::formRequest('App\Http\Requests\Admin\Shop\StoreVariationPost', '#variation-form') !!}
    <script>
        $(function() {
            initEditor();
            initSaveForm('#variation-form')
        });
    </script>
@endpush
