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('suggestion::suggestions.label.name'), "placeholder" => trans('suggestion::suggestions.placeholder.name'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'description' => [ "type" => 'textarea', "label" => trans('suggestion::suggestions.label.description'), "placeholder" => trans('suggestion::suggestions.placeholder.description'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'executions_amount' => [ "type" => 'numeric', "label" => trans('suggestion::suggestions.label.executions_amount'), "placeholder" => trans('suggestion::suggestions.placeholder.executions_amount'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'min_participants' => [ "type" => 'numeric', "label" => trans('suggestion::suggestions.label.min_participants'), "placeholder" => trans('suggestion::suggestions.placeholder.min_participants'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'max_participants' => [ "type" => 'numeric', "label" => trans('suggestion::suggestions.label.max_participants'), "placeholder" => trans('suggestion::suggestions.placeholder.max_participants'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'cost' => [ "type" => 'decimal', "label" => trans('suggestion::suggestions.label.cost'), "placeholder" => trans('suggestion::suggestions.placeholder.cost'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'available_dates' => [ "type" => 'checkboxes', "label" => trans('suggestion::suggestions.label.available_dates'), "placeholder" => trans('suggestion::suggestions.placeholder.available_dates'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'relevant_classes' => [ "type" => 'checkboxes', "label" => trans('suggestion::suggestions.label.relevant_classes'), "placeholder" => trans('suggestion::suggestions.placeholder.relevant_classes'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'preferred_time' => [ "type" => 'time_picker', "label" => trans('suggestion::suggestions.label.preferred_time'), "placeholder" => trans('suggestion::suggestions.placeholder.preferred_time'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }