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' => [ 'style_name' => [ "type" => 'text', "label" => trans('theme-style::styles.label.style_name'), "placeholder" => trans('theme-style::styles.placeholder.style_name'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'color_1' => [ "type" => 'color', "label" => trans('theme-style::styles.label.color_1'), "placeholder" => trans('theme-style::styles.placeholder.color_1'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'color_2' => [ "type" => 'color', "label" => trans('theme-style::styles.label.color_2'), "placeholder" => trans('theme-style::styles.placeholder.color_2'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'color_3' => [ "type" => 'color', "label" => trans('theme-style::styles.label.color_3'), "placeholder" => trans('theme-style::styles.placeholder.color_3'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'logo_header' => [ "type" => 'file', "label" => trans('theme-style::styles.label.logo_header'), "placeholder" => trans('theme-style::styles.placeholder.logo_header'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'logo_footer' => [ "type" => 'file', "label" => trans('theme-style::styles.label.logo_footer'), "placeholder" => trans('theme-style::styles.placeholder.logo_footer'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'slider_image' => [ "type" => 'file', "label" => trans('theme-style::styles.label.slider_image'), "placeholder" => trans('theme-style::styles.placeholder.slider_image'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }