@include('components.form', [
'id' => $id_form, // INPUT ID BIND
'resource' => 'orders', // FORM RESOURCE TARGET
'method' => config('const.crud.create'), // RESOURCE METHOD AVAILABLE
'through' => $through, // THROUGH SPEC
'refs' => [
'table' => "{$id_table}Table", // RECORDS TABLE
'form' => "{$id_form}Form" // RECORDS TABLE
],
'groups' => [
[
'product_code' => [
'required' => true,
'type' => 'input-text',
'label' => __('form.label.product'),
'label-class' => 'col-md-1 small',
'div-class' => 'col-md-5',
'input-class' => 'select2x',
'input-attrs' => 'data-init="product_code:product_label"',
'placeholder' => __('form.placeholder.product.name'),
'help' => __('form.help.product.name'),
],
'quantity' => [
'required' => true,
'type' => 'input-text',
'label' => __('form.label.quantity'),
'label-class' => 'col-md-1 small',
'div-class' => 'col-md-2',
'input-class' => 'centered padding0',
'placeholder' => __('form.placeholder.product.quantity'),
'help' => __('form.help.product.quantity')
],
'notes' => [
'type' => 'textarea',
'label-class' => 'col-md-1 small',
'div-class' => 'col-md-2',
'rows' => '2', // 2 LINES
'label' => __('form.label.notes'),
]
],
]
])
{{ __( 'Ordered Products') }}
@include('components.table', [
'id' => $id_table, // INPUT ID BIND
'class' => 'table cell-border hover order-products',
'resource' => 'orders', // FORM RESOURCE TARGET
'method' => config('const.crud.delete'), // RESOURCE METHOD AVAILABLE
'through' => $through, // THROUGH SPEC
'rows_id' => "pivot.id", // ROWS ID FIELD SPEC (DEFAULT ID)
'data' => $products, // PASS DATA IF ANY
'headers' => $headers,
'footers' => [
[
'attrs' => 'class="total" colspan="4" style="text-align:right"',
'label' => 'Total'
]
],
])