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