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' => [ 'company_id' => [ "type" => 'numeric', "label" => trans('service::subscription.label.company_id'), "placeholder" => trans('service::subscription.placeholder.company_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'job_id' => [ "type" => 'numeric', "label" => trans('service::subscription.label.job_id'), "placeholder" => trans('service::subscription.placeholder.job_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'booking_id' => [ "type" => 'numeric', "label" => trans('service::subscription.label.booking_id'), "placeholder" => trans('service::subscription.placeholder.booking_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'repeat_interval' => [ "type" => 'text', "label" => trans('service::subscription.label.repeat_interval'), "placeholder" => trans('service::subscription.placeholder.repeat_interval'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'start_date' => [ "type" => 'date_picker', "label" => trans('service::subscription.label.start_date'), "placeholder" => trans('service::subscription.placeholder.start_date'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'end_date' => [ "type" => 'date_picker', "label" => trans('service::subscription.label.end_date'), "placeholder" => trans('service::subscription.placeholder.end_date'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }