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('plan::plan.label.name'), "placeholder" => trans('plan::plan.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'sort_order' => [ "type" => 'numeric', "label" => trans('plan::plan.label.sort_order'), "placeholder" => trans('plan::plan.placeholder.sort_order'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'price' => [ "type" => 'numeric', "label" => trans('plan::plan.label.price'), "placeholder" => trans('plan::plan.placeholder.price'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'interval' => [ "type" => 'text', "label" => trans('plan::plan.label.interval'), "placeholder" => trans('plan::plan.placeholder.interval'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'interval_count' => [ "type" => 'numeric', "label" => trans('plan::plan.label.interval_count'), "placeholder" => trans('plan::plan.placeholder.interval_count'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'trial_period_days' => [ "type" => 'numeric', "label" => trans('plan::plan.label.trial_period_days'), "placeholder" => trans('plan::plan.placeholder.trial_period_days'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'description' => [ "type" => 'text', "label" => trans('plan::plan.label.description'), "placeholder" => trans('plan::plan.placeholder.description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }