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' => [ 'project_id' => [ "type" => 'select', "label" => trans('project::milestone.label.project_id'), "placeholder" => trans('project::milestone.placeholder.project_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'name' => [ "type" => 'text', "label" => trans('project::milestone.label.name'), "placeholder" => trans('project::milestone.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'link_payment' => [ "type" => 'select', "label" => trans('project::milestone.label.link_payment'), "placeholder" => trans('project::milestone.placeholder.link_payment'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'signoff_recvd' => [ "type" => 'select', "label" => trans('project::milestone.label.signoff_recvd'), "placeholder" => trans('project::milestone.placeholder.signoff_recvd'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'signoff_date' => [ "type" => 'date_picker', "label" => trans('project::milestone.label.signoff_date'), "placeholder" => trans('project::milestone.placeholder.signoff_date'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'remarks' => [ "type" => 'html_editor', "label" => trans('project::milestone.label.remarks'), "placeholder" => trans('project::milestone.placeholder.remarks'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'followup' => [ "type" => 'textarea', "label" => trans('project::milestone.label.followup'), "placeholder" => trans('project::milestone.placeholder.followup'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }