setForm(); } /** * Return form elements. * * @return array. */ public function form($element = 'fields', $grouped = true) { $item = collect($this->form->get($element)); if ($element == 'fields' && $grouped == true) { return $item->groupBy(['group', 'section']); } return $item; } /** * Sets the form and form elements. * @return null. */ public function setForm() { $this->form = collect([ 'form' => [ 'store' => [], 'update' => [], ], 'groups' => [ 'main' => 'Main', ], 'fields' => [ 'site_id' => [ "type" => 'select', "label" => trans('supplier::contract.label.site_id'), "placeholder" => trans('supplier::contract.placeholder.site_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'supplier_id' => [ "type" => 'select', "label" => trans('supplier::contract.label.supplier_id'), "placeholder" => trans('supplier::contract.placeholder.supplier_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'contract_no' => [ "type" => 'text', "label" => trans('supplier::contract.label.contract_no'), "placeholder" => trans('supplier::contract.placeholder.contract_no'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'contract_name' => [ "type" => 'text', "label" => trans('supplier::contract.label.contract_name'), "placeholder" => trans('supplier::contract.placeholder.contract_name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'contract_date' => [ "type" => 'date_picker', "label" => trans('supplier::contract.label.contract_date'), "placeholder" => trans('supplier::contract.placeholder.contract_date'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'expiry_date' => [ "type" => 'date_picker', "label" => trans('supplier::contract.label.expiry_date'), "placeholder" => trans('supplier::contract.placeholder.expiry_date'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'details' => [ "type" => 'textarea', "label" => trans('supplier::contract.label.details'), "placeholder" => trans('supplier::contract.placeholder.details'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }