@extends('master')
@section('content')
@include('modals.couriers', [
'id' => 'couriersEditContainer',
'title' => __('label.edit.courier'),
'refs' => [ // RELATED OBJECTS
'form' => 'couriersEditForm' // CONTAINED FORM SEE ID ABOVE
],
'layout' => [
'edit' => true,
'target' => 'forms.couriers',
'data' => [
'id' => 'couriersEdit', // INPUT ID BIND
'method' => config('const.crud.update'), // REQUIRED FORM METHOD
'table' => 'couriersRecords', // RELATED TABLE ID
'resource' => 'couriers', // ! DB TABLE RESOURCE NAME (RESOURCE ID) !
'refs' => [ // RELATED OBJECTS
'modal' => 'couriersEditContainerModal', // CONTAINER MODAL
'table' => 'couriersRecordsTable' // RECORDS TABLE
],
],
]
])
@include('modals.courier-products', [
'id' => 'courierUnloadContainer',
'title' => __('label.title.load-board'),
'refs' => [ // RELATED OBJECTS
'table' => 'courierUnloadRecordsTable', // CONTAINED TABLE
'base-table' => 'couriersRecordsTable', // BASE RECORDS TABLE
],
'layout' => [
'target' => 'tables.courier-unload',
'data' => [
'id' => 'courierUnloadRecords', // TABLE ID
'src' => 'courier.products.data', // DATA ROUTE NAME
'delete_confirm_handle' => true,
'resource' => 'products', // ! DB TABLE RESOURCE NAME (RESOURCE ID) !
'data' => [],
'through' => true, // INDIRECT REDERENCE
'routes' => [
config('const.crud.delete') => Utils::indexRoute('courier.products.delete'),
],
'calls' => [
'clear-board' => [
'type' => config('const.crud.delete'),
'url' => Utils::indexRoute('courier.products.clear'),
],
],
'refs' => [ // RELATED OBJECTS
'table' => 'couriersRecordsTable', // BASE RECORDS TABLE (FOR CONTEXT)
'modal' => 'courierUnloadContainerModal', // COMPONENT FORM
],
],
]
])
@include('modals.courier-products', [
'id' => 'courierLoadContainer',
'title' => __('label.title.load-board'),
'refs' => [ // RELATED OBJECTS
'table' => 'courierLoadRecordsTable', // CONTAINED TABLE
'base-table' => 'couriersRecordsTable', // BASE RECORDS TABLE
],
'layout' => [
'target' => 'tables.courier-load',
'data' => [
'id' => 'courierLoadRecords', // TABLE ID
'src' => 'courier.products.data', // DATA ROUTE NAME
'resource' => 'products', // ! DB TABLE RESOURCE NAME (RESOURCE ID) !
'data' => [],
'through' => true, // INDIRECT REDERENCE
'routes' => [
config('const.crud.delete') => Utils::indexRoute('courier.products.delete'),
],
'refs' => [ // RELATED OBJECTS
'table' => 'couriersRecordsTable', // BASE RECORDS TABLE (FOR CONTEXT)
'modal' => 'courierLoadContainerModal', // COMPONENT FORM
'new-product' => 'productsAddContainerModal', // NEW PAYMENT MODAL
],
],
]
])
@include('modals.products', [
'id' => 'productsAddContainer',
'title' => __('label.add.product'),
'refs' => [ // RELATED OBJECTS
'form' => 'productsAddForm', // CONTAINED FORM SEE ID ABOVE
],
'layout' => [
'target' => 'forms.courier-products',
'data' => [
'id' => 'productsAdd', // INPUT ID BIND
//'method' => config('const.crud.create'), // REQUIRED FORM METHOD
'table' => 'productsRecords', // RELATED TABLE ID
'resource' => 'products', // ! DB TABLE RESOURCE NAME (RESOURCE ID) !
'routes' => [
config('const.crud.create') => Utils::indexRoute('courier.products.store'),
],
'refs' => [ // RELATED OBJECTS
'modal' => 'productsAddContainerModal', // CONTAINER MODAL
'table' => 'courierLoadRecordsTable', // RECORDS TABLE TO UPDATE
],
],
]
])
@include('components.tabs', [
'active' => 0,
'tabs' => [
[
'title' => trans_choice('label.courier', 2),
'portlet' => [
'icon' => 'fa fa-bars',
'title' => __('label.records.courier'),
'reload' => true
],
'layout' => [
'target' => 'tables.couriers',
'data' => [
'id' => 'couriersRecords', // TABLE ID
'edit' => 'couriersEditContainer', // (ID) MODAL EDIT REF
'resource' => 'couriers', // ! DB TABLE RESOURCE NAME (RESOURCE ID) !
'method' => config('const.crud.delete'), // RESOURCE METHOD AVAILABLE
'data' => $couriers,
'refs' => [
'load' => 'courierLoadContainerModal', // ORDER PRODUCTS HANDLER
'unload' => 'courierUnloadContainerModal', // ORDER PRODUCTS HANDLER
]
],
]
],
[
'title' => __('label.new.courier'),
'portlet' => [
'icon' => 'fa fa-bars',
'title' => __('label.content.courier'),
],
'layout' => [
'target' => 'forms.couriers',
'data' => [
'id' => 'couriersInput', // FORM ID
'static' => '0', // NOT DINAMIC JUST ALWAYS INS
'resource' => 'couriers', // ! DB TABLE RESOURCE NAME (RESOURCE ID) !
'refs' => [ // RELATED OBJECTS
'table' => 'couriersRecordsTable', // RECORDS TABLE
],
],
]
]
],
])
@stop