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' => [ 'category_id' => [ "type" => 'numeric', "label" => trans('offplan::unit.label.category_id'), "placeholder" => trans('offplan::unit.placeholder.category_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'number' => [ "type" => 'text', "label" => trans('offplan::unit.label.number'), "placeholder" => trans('offplan::unit.placeholder.number'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'price' => [ "type" => 'numeric', "label" => trans('offplan::unit.label.price'), "placeholder" => trans('offplan::unit.placeholder.price'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'bed' => [ "type" => 'decimal', "label" => trans('offplan::unit.label.bed'), "placeholder" => trans('offplan::unit.placeholder.bed'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'bath' => [ "type" => 'numeric', "label" => trans('offplan::unit.label.bath'), "placeholder" => trans('offplan::unit.placeholder.bath'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'view' => [ "type" => 'text', "label" => trans('offplan::unit.label.view'), "placeholder" => trans('offplan::unit.placeholder.view'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }