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' => [ 'campaign_type' => [ "type" => 'text', "label" => trans('campaign::campaign.label.campaign_type'), "placeholder" => trans('campaign::campaign.placeholder.campaign_type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'sourse' => [ "type" => 'text', "label" => trans('campaign::campaign.label.sourse'), "placeholder" => trans('campaign::campaign.placeholder.sourse'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'title' => [ "type" => 'text', "label" => trans('campaign::campaign.label.title'), "placeholder" => trans('campaign::campaign.placeholder.title'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'goals' => [ "type" => 'numeric', "label" => trans('campaign::campaign.label.goals'), "placeholder" => trans('campaign::campaign.placeholder.goals'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'file' => [ "type" => 'text', "label" => trans('campaign::campaign.label.file'), "placeholder" => trans('campaign::campaign.placeholder.file'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'category' => [ "type" => 'text', "label" => trans('campaign::campaign.label.category'), "placeholder" => trans('campaign::campaign.placeholder.category'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'parser_id' => [ "type" => 'text', "label" => trans('campaign::campaign.label.parser_id'), "placeholder" => trans('campaign::campaign.placeholder.parser_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'complete_percentage' => [ "type" => 'text', "label" => trans('campaign::campaign.label.complete_percentage'), "placeholder" => trans('campaign::campaign.placeholder.complete_percentage'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'goals_count' => [ "type" => 'text', "label" => trans('campaign::campaign.label.goals_count'), "placeholder" => trans('campaign::campaign.placeholder.goals_count'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'lead_count' => [ "type" => 'numeric', "label" => trans('campaign::campaign.label.lead_count'), "placeholder" => trans('campaign::campaign.placeholder.lead_count'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'price' => [ "type" => 'text', "label" => trans('campaign::campaign.label.price'), "placeholder" => trans('campaign::campaign.placeholder.price'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }