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