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' => [ 'parent_id' => [ "type" => 'numeric', "label" => trans('location::location.label.parent_id'), "placeholder" => trans('location::location.placeholder.parent_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'nest_left' => [ "type" => 'numeric', "label" => trans('location::location.label.nest_left'), "placeholder" => trans('location::location.placeholder.nest_left'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'nest_right' => [ "type" => 'numeric', "label" => trans('location::location.label.nest_right'), "placeholder" => trans('location::location.placeholder.nest_right'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'nest_depth' => [ "type" => 'numeric', "label" => trans('location::location.label.nest_depth'), "placeholder" => trans('location::location.placeholder.nest_depth'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'name' => [ "type" => 'text', "label" => trans('location::location.label.name'), "placeholder" => trans('location::location.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'description' => [ "type" => 'text', "label" => trans('location::location.label.description'), "placeholder" => trans('location::location.placeholder.description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'type' => [ "type" => 'radios', "label" => trans('location::location.label.type'), "placeholder" => trans('location::location.placeholder.type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'latitude' => [ "type" => 'text', "label" => trans('location::location.label.latitude'), "placeholder" => trans('location::location.placeholder.latitude'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'longitude' => [ "type" => 'text', "label" => trans('location::location.label.longitude'), "placeholder" => trans('location::location.placeholder.longitude'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }