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' => [ 'name' => [ "type" => 'text', "label" => trans('campaign::campaign.label.name'), "placeholder" => trans('campaign::campaign.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'brand_id' => [ "type" => 'numeric', "label" => trans('campaign::campaign.label.brand_id'), "placeholder" => trans('campaign::campaign.placeholder.brand_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'price' => [ "type" => 'decimal', "label" => trans('campaign::campaign.label.price'), "placeholder" => trans('campaign::campaign.placeholder.price'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'planning_date' => [ "type" => 'date_picker', "label" => trans('campaign::campaign.label.planning_date'), "placeholder" => trans('campaign::campaign.placeholder.planning_date'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'start_campaign' => [ "type" => 'date_picker', "label" => trans('campaign::campaign.label.start_campaign'), "placeholder" => trans('campaign::campaign.placeholder.start_campaign'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'end_campaign' => [ "type" => 'date_picker', "label" => trans('campaign::campaign.label.end_campaign'), "placeholder" => trans('campaign::campaign.placeholder.end_campaign'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'description' => [ "type" => 'text', "label" => trans('campaign::campaign.label.description'), "placeholder" => trans('campaign::campaign.placeholder.description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'objectives' => [ "type" => 'text', "label" => trans('campaign::campaign.label.objectives'), "placeholder" => trans('campaign::campaign.placeholder.objectives'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'targetgroups' => [ "type" => 'text', "label" => trans('campaign::campaign.label.targetgroups'), "placeholder" => trans('campaign::campaign.placeholder.targetgroups'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'content' => [ "type" => 'text', "label" => trans('campaign::campaign.label.content'), "placeholder" => trans('campaign::campaign.placeholder.content'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'images' => [ "type" => 'decimal', "label" => trans('campaign::campaign.label.images'), "placeholder" => trans('campaign::campaign.placeholder.images'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'video' => [ "type" => 'decimal', "label" => trans('campaign::campaign.label.video'), "placeholder" => trans('campaign::campaign.placeholder.video'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'total_budget' => [ "type" => 'decimal', "label" => trans('campaign::campaign.label.total_budget'), "placeholder" => trans('campaign::campaign.placeholder.total_budget'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'media_cost' => [ "type" => 'decimal', "label" => trans('campaign::campaign.label.media_cost'), "placeholder" => trans('campaign::campaign.placeholder.media_cost'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'sum_discount' => [ "type" => 'decimal', "label" => trans('campaign::campaign.label.sum_discount'), "placeholder" => trans('campaign::campaign.placeholder.sum_discount'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'total_mediacost' => [ "type" => 'decimal', "label" => trans('campaign::campaign.label.total_mediacost'), "placeholder" => trans('campaign::campaign.placeholder.total_mediacost'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'incentives' => [ "type" => 'decimal', "label" => trans('campaign::campaign.label.incentives'), "placeholder" => trans('campaign::campaign.placeholder.incentives'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'rest_budget' => [ "type" => 'decimal', "label" => trans('campaign::campaign.label.rest_budget'), "placeholder" => trans('campaign::campaign.placeholder.rest_budget'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'timing' => [ "type" => 'text', "label" => trans('campaign::campaign.label.timing'), "placeholder" => trans('campaign::campaign.placeholder.timing'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'reach' => [ "type" => 'text', "label" => trans('campaign::campaign.label.reach'), "placeholder" => trans('campaign::campaign.placeholder.reach'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'publishing' => [ "type" => 'text', "label" => trans('campaign::campaign.label.publishing'), "placeholder" => trans('campaign::campaign.placeholder.publishing'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'variant_id' => [ "type" => 'numeric', "label" => trans('campaign::campaign.label.variant_id'), "placeholder" => trans('campaign::campaign.placeholder.variant_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'participants' => [ "type" => 'text', "label" => trans('campaign::campaign.label.participants'), "placeholder" => trans('campaign::campaign.placeholder.participants'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'AIs' => [ "type" => 'text', "label" => trans('campaign::campaign.label.AIs'), "placeholder" => trans('campaign::campaign.placeholder.AIs'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'CTR' => [ "type" => 'text', "label" => trans('campaign::campaign.label.CTR'), "placeholder" => trans('campaign::campaign.placeholder.CTR'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'contact' => [ "type" => 'text', "label" => trans('campaign::campaign.label.contact'), "placeholder" => trans('campaign::campaign.placeholder.contact'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'list_price' => [ "type" => 'decimal', "label" => trans('campaign::campaign.label.list_price'), "placeholder" => trans('campaign::campaign.placeholder.list_price'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'paid_price' => [ "type" => 'decimal', "label" => trans('campaign::campaign.label.paid_price'), "placeholder" => trans('campaign::campaign.placeholder.paid_price'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'discount' => [ "type" => 'decimal', "label" => trans('campaign::campaign.label.discount'), "placeholder" => trans('campaign::campaign.placeholder.discount'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }