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' => [ 'assigned_id' => [ "type" => 'numeric', "label" => trans('bixocampaign::bixo_campaign.label.assigned_id'), "placeholder" => trans('bixocampaign::bixo_campaign.placeholder.assigned_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'start_date' => [ "type" => 'date_picker', "label" => trans('bixocampaign::bixo_campaign.label.start_date'), "placeholder" => trans('bixocampaign::bixo_campaign.placeholder.start_date'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'end_date' => [ "type" => 'date_picker', "label" => trans('bixocampaign::bixo_campaign.label.end_date'), "placeholder" => trans('bixocampaign::bixo_campaign.placeholder.end_date'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'name' => [ "type" => 'text', "label" => trans('bixocampaign::bixo_campaign.label.name'), "placeholder" => trans('bixocampaign::bixo_campaign.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'type' => [ "type" => 'text', "label" => trans('bixocampaign::bixo_campaign.label.type'), "placeholder" => trans('bixocampaign::bixo_campaign.placeholder.type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'Budget' => [ "type" => 'numeric', "label" => trans('bixocampaign::bixo_campaign.label.Budget'), "placeholder" => trans('bixocampaign::bixo_campaign.placeholder.Budget'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'team_id' => [ "type" => 'numeric', "label" => trans('bixocampaign::bixo_campaign.label.team_id'), "placeholder" => trans('bixocampaign::bixo_campaign.placeholder.team_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }