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' => [ 'subscribable_id' => [ "type" => 'numeric', "label" => trans('plan::subscription.label.subscribable_id'), "placeholder" => trans('plan::subscription.placeholder.subscribable_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'subscribable_type' => [ "type" => 'text', "label" => trans('plan::subscription.label.subscribable_type'), "placeholder" => trans('plan::subscription.placeholder.subscribable_type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'plan_id' => [ "type" => 'numeric', "label" => trans('plan::subscription.label.plan_id'), "placeholder" => trans('plan::subscription.placeholder.plan_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'name' => [ "type" => 'text', "label" => trans('plan::subscription.label.name'), "placeholder" => trans('plan::subscription.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'trial_ends_at' => [ "type" => 'date_picker', "label" => trans('plan::subscription.label.trial_ends_at'), "placeholder" => trans('plan::subscription.placeholder.trial_ends_at'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'starts_at' => [ "type" => 'date_picker', "label" => trans('plan::subscription.label.starts_at'), "placeholder" => trans('plan::subscription.placeholder.starts_at'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'ends_at' => [ "type" => 'date_picker', "label" => trans('plan::subscription.label.ends_at'), "placeholder" => trans('plan::subscription.placeholder.ends_at'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'canceled_at' => [ "type" => 'date_picker', "label" => trans('plan::subscription.label.canceled_at'), "placeholder" => trans('plan::subscription.placeholder.canceled_at'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'payment_mode' => [ "type" => 'radios', "label" => trans('plan::subscription.label.payment_mode'), "placeholder" => trans('plan::subscription.placeholder.payment_mode'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'transaction_no' => [ "type" => 'numeric', "label" => trans('plan::subscription.label.transaction_no'), "placeholder" => trans('plan::subscription.placeholder.transaction_no'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'bank' => [ "type" => 'text', "label" => trans('plan::subscription.label.bank'), "placeholder" => trans('plan::subscription.placeholder.bank'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'branch' => [ "type" => 'text', "label" => trans('plan::subscription.label.branch'), "placeholder" => trans('plan::subscription.placeholder.branch'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'amount' => [ "type" => 'decimal', "label" => trans('plan::subscription.label.amount'), "placeholder" => trans('plan::subscription.placeholder.amount'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'date' => [ "type" => 'date_picker', "label" => trans('plan::subscription.label.date'), "placeholder" => trans('plan::subscription.placeholder.date'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'payment_gateway_name' => [ "type" => 'text', "label" => trans('plan::subscription.label.payment_gateway_name'), "placeholder" => trans('plan::subscription.placeholder.payment_gateway_name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }