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' => [ 'deal_id' => [ "type" => 'numeric', "label" => trans('aml::sanction.label.deal_id'), "placeholder" => trans('aml::sanction.placeholder.deal_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'ref' => [ "type" => 'text', "label" => trans('aml::sanction.label.ref'), "placeholder" => trans('aml::sanction.placeholder.ref'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'deal_ref' => [ "type" => 'text', "label" => trans('aml::sanction.label.deal_ref'), "placeholder" => trans('aml::sanction.placeholder.deal_ref'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'type' => [ "type" => 'text', "label" => trans('aml::sanction.label.type'), "placeholder" => trans('aml::sanction.placeholder.type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'score' => [ "type" => 'decimal', "label" => trans('aml::sanction.label.score'), "placeholder" => trans('aml::sanction.placeholder.score'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'buyer_name' => [ "type" => 'text', "label" => trans('aml::sanction.label.buyer_name'), "placeholder" => trans('aml::sanction.placeholder.buyer_name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'seller_name' => [ "type" => 'text', "label" => trans('aml::sanction.label.seller_name'), "placeholder" => trans('aml::sanction.placeholder.seller_name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'buyer_names' => [ "type" => 'text', "label" => trans('aml::sanction.label.buyer_names'), "placeholder" => trans('aml::sanction.placeholder.buyer_names'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'seller_names' => [ "type" => 'text', "label" => trans('aml::sanction.label.seller_names'), "placeholder" => trans('aml::sanction.placeholder.seller_names'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'notes' => [ "type" => 'text', "label" => trans('aml::sanction.label.notes'), "placeholder" => trans('aml::sanction.placeholder.notes'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }