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' => [ 'code' => [ "type" => 'text', "label" => trans('location::country.label.code'), "placeholder" => trans('location::country.placeholder.code'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'name' => [ "type" => 'text', "label" => trans('location::country.label.name'), "placeholder" => trans('location::country.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'continent' => [ "type" => 'radios', "label" => trans('location::country.label.continent'), "placeholder" => trans('location::country.placeholder.continent'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'region' => [ "type" => 'text', "label" => trans('location::country.label.region'), "placeholder" => trans('location::country.placeholder.region'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'surfacearea' => [ "type" => 'decimal', "label" => trans('location::country.label.surfacearea'), "placeholder" => trans('location::country.placeholder.surfacearea'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'indepyear' => [ "type" => 'numeric', "label" => trans('location::country.label.indepyear'), "placeholder" => trans('location::country.placeholder.indepyear'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'population' => [ "type" => 'numeric', "label" => trans('location::country.label.population'), "placeholder" => trans('location::country.placeholder.population'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'life_expectancy' => [ "type" => 'decimal', "label" => trans('location::country.label.life_expectancy'), "placeholder" => trans('location::country.placeholder.life_expectancy'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'gnp' => [ "type" => 'decimal', "label" => trans('location::country.label.gnp'), "placeholder" => trans('location::country.placeholder.gnp'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'gnpoid' => [ "type" => 'decimal', "label" => trans('location::country.label.gnpoid'), "placeholder" => trans('location::country.placeholder.gnpoid'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'local_name' => [ "type" => 'text', "label" => trans('location::country.label.local_name'), "placeholder" => trans('location::country.placeholder.local_name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'government_form' => [ "type" => 'text', "label" => trans('location::country.label.government_form'), "placeholder" => trans('location::country.placeholder.government_form'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'head_of_state' => [ "type" => 'text', "label" => trans('location::country.label.head_of_state'), "placeholder" => trans('location::country.placeholder.head_of_state'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'capital' => [ "type" => 'numeric', "label" => trans('location::country.label.capital'), "placeholder" => trans('location::country.placeholder.capital'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'code2' => [ "type" => 'text', "label" => trans('location::country.label.code2'), "placeholder" => trans('location::country.placeholder.code2'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ')' => [ "type" => 'package::package.formcontrols.ON', "label" => trans('location::country.label.)'), "placeholder" => trans('location::country.placeholder.)'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }