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' => [ 'first_name' => [ "type" => 'text', "label" => trans('aml::name.label.first_name'), "placeholder" => trans('aml::name.placeholder.first_name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'middle_name' => [ "type" => 'text', "label" => trans('aml::name.label.middle_name'), "placeholder" => trans('aml::name.placeholder.middle_name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'last_name' => [ "type" => 'text', "label" => trans('aml::name.label.last_name'), "placeholder" => trans('aml::name.placeholder.last_name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'family_name' => [ "type" => 'text', "label" => trans('aml::name.label.family_name'), "placeholder" => trans('aml::name.placeholder.family_name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'nationality' => [ "type" => 'text', "label" => trans('aml::name.label.nationality'), "placeholder" => trans('aml::name.placeholder.nationality'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'dob' => [ "type" => 'date_picker', "label" => trans('aml::name.label.dob'), "placeholder" => trans('aml::name.placeholder.dob'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'passport_no' => [ "type" => 'text', "label" => trans('aml::name.label.passport_no'), "placeholder" => trans('aml::name.placeholder.passport_no'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'passport_expiry' => [ "type" => 'date_picker', "label" => trans('aml::name.label.passport_expiry'), "placeholder" => trans('aml::name.placeholder.passport_expiry'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'emirates_id' => [ "type" => 'text', "label" => trans('aml::name.label.emirates_id'), "placeholder" => trans('aml::name.placeholder.emirates_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'description' => [ "type" => 'text', "label" => trans('aml::name.label.description'), "placeholder" => trans('aml::name.placeholder.description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }