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' => [ 'start' => [ "type" => 'date_time_picker', "label" => trans('calendars::calendar.label.start'), "placeholder" => trans('calendars::calendar.placeholder.start'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'end' => [ "type" => 'date_time_picker', "label" => trans('calendars::calendar.label.end'), "placeholder" => trans('calendars::calendar.placeholder.end'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'category' => [ "type" => 'text', "label" => trans('calendars::calendar.label.category'), "placeholder" => trans('calendars::calendar.placeholder.category'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'sub_category' => [ "type" => 'text', "label" => trans('calendars::calendar.label.sub_category'), "placeholder" => trans('calendars::calendar.placeholder.sub_category'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'location' => [ "type" => 'text', "label" => trans('calendars::calendar.label.location'), "placeholder" => trans('calendars::calendar.placeholder.location'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'title' => [ "type" => 'text', "label" => trans('calendars::calendar.label.title'), "placeholder" => trans('calendars::calendar.placeholder.title'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'details' => [ "type" => 'text', "label" => trans('calendars::calendar.label.details'), "placeholder" => trans('calendars::calendar.placeholder.details'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'created_by' => [ "type" => 'numeric', "label" => trans('calendars::calendar.label.created_by'), "placeholder" => trans('calendars::calendar.placeholder.created_by'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }