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' => [ 'country_id' => [ "type" => 'numeric', "label" => trans('locations::properties.label.country_id'), "placeholder" => trans('locations::properties.placeholder.country_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'city_id' => [ "type" => 'numeric', "label" => trans('locations::properties.label.city_id'), "placeholder" => trans('locations::properties.placeholder.city_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'location_id' => [ "type" => 'numeric', "label" => trans('locations::properties.label.location_id'), "placeholder" => trans('locations::properties.placeholder.location_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'sublocation_id' => [ "type" => 'numeric', "label" => trans('locations::properties.label.sublocation_id'), "placeholder" => trans('locations::properties.placeholder.sublocation_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'name' => [ "type" => 'text', "label" => trans('locations::properties.label.name'), "placeholder" => trans('locations::properties.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'code' => [ "type" => 'text', "label" => trans('locations::properties.label.code'), "placeholder" => trans('locations::properties.placeholder.code'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'code_loc' => [ "type" => 'numeric', "label" => trans('locations::properties.label.code_loc'), "placeholder" => trans('locations::properties.placeholder.code_loc'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'text' => [ "type" => 'text', "label" => trans('locations::properties.label.text'), "placeholder" => trans('locations::properties.placeholder.text'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'photos' => [ "type" => 'text', "label" => trans('locations::properties.label.photos'), "placeholder" => trans('locations::properties.placeholder.photos'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'floor_plans' => [ "type" => 'text', "label" => trans('locations::properties.label.floor_plans'), "placeholder" => trans('locations::properties.placeholder.floor_plans'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'min_price' => [ "type" => 'numeric', "label" => trans('locations::properties.label.min_price'), "placeholder" => trans('locations::properties.placeholder.min_price'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'max_price' => [ "type" => 'numeric', "label" => trans('locations::properties.label.max_price'), "placeholder" => trans('locations::properties.placeholder.max_price'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ')' => [ "type" => 'package::package.formcontrols.ON', "label" => trans('locations::properties.label.)'), "placeholder" => trans('locations::properties.placeholder.)'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }