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