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' => [ 'contato_id' => [ "type" => 'select', "label" => trans('lead::lead.label.contato_id'), "placeholder" => trans('lead::lead.placeholder.contato_id'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'como_chegou_ate_nos' => [ "type" => 'select', "label" => trans('lead::lead.label.como_chegou_ate_nos'), "placeholder" => trans('lead::lead.placeholder.como_chegou_ate_nos'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'segmento' => [ "type" => 'select', "label" => trans('lead::lead.label.segmento'), "placeholder" => trans('lead::lead.placeholder.segmento'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'tipo_contato' => [ "type" => 'select', "label" => trans('lead::lead.label.tipo_contato'), "placeholder" => trans('lead::lead.placeholder.tipo_contato'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'empreendimento' => [ "type" => 'text', "label" => trans('lead::lead.label.empreendimento'), "placeholder" => trans('lead::lead.placeholder.empreendimento'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'outras_informacoes' => [ "type" => 'text', "label" => trans('lead::lead.label.outras_informacoes'), "placeholder" => trans('lead::lead.placeholder.outras_informacoes'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'data_criacao' => [ "type" => 'date', "label" => trans('lead::lead.label.data_criacao'), "placeholder" => trans('lead::lead.placeholder.data_criacao'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'status' => [ "type" => 'select', "label" => trans('lead::lead.label.status'), "placeholder" => trans('lead::lead.placeholder.status'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'motivo_status' => [ "type" => 'textarea', "label" => trans('lead::lead.label.motivo_status'), "placeholder" => trans('lead::lead.placeholder.motivo_status'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }