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' => [ 'variant_id' => [ "type" => 'numeric', "label" => trans('campaign::campaign_variant.label.variant_id'), "placeholder" => trans('campaign::campaign_variant.placeholder.variant_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'campaign_id' => [ "type" => 'numeric', "label" => trans('campaign::campaign_variant.label.campaign_id'), "placeholder" => trans('campaign::campaign_variant.placeholder.campaign_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'brand_id' => [ "type" => 'numeric', "label" => trans('campaign::campaign_variant.label.brand_id'), "placeholder" => trans('campaign::campaign_variant.placeholder.brand_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }