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' => [ 'provider_id' => [ "type" => 'numeric', "label" => trans('service::provider_availability.label.provider_id'), "placeholder" => trans('service::provider_availability.placeholder.provider_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'date' => [ "type" => 'date_picker', "label" => trans('service::provider_availability.label.date'), "placeholder" => trans('service::provider_availability.placeholder.date'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'start_time' => [ "type" => 'time_picker', "label" => trans('service::provider_availability.label.start_time'), "placeholder" => trans('service::provider_availability.placeholder.start_time'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'end_time' => [ "type" => 'time_picker', "label" => trans('service::provider_availability.label.end_time'), "placeholder" => trans('service::provider_availability.placeholder.end_time'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'location' => [ "type" => 'text', "label" => trans('service::provider_availability.label.location'), "placeholder" => trans('service::provider_availability.placeholder.location'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'description' => [ "type" => 'text', "label" => trans('service::provider_availability.label.description'), "placeholder" => trans('service::provider_availability.placeholder.description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'type' => [ "type" => 'text', "label" => trans('service::provider_availability.label.type'), "placeholder" => trans('service::provider_availability.placeholder.type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }