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' => [ 'restaurant_id' => [ "type" => 'numeric', "label" => trans('website::website.label.restaurant_id'), "placeholder" => trans('website::website.placeholder.restaurant_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'promo_image' => [ "type" => 'text', "label" => trans('website::website.label.promo_image'), "placeholder" => trans('website::website.placeholder.promo_image'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'promo_text' => [ "type" => 'text', "label" => trans('website::website.label.promo_text'), "placeholder" => trans('website::website.placeholder.promo_text'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'type' => [ "type" => 'text', "label" => trans('website::website.label.type'), "placeholder" => trans('website::website.placeholder.type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'custom_page2' => [ "type" => 'text', "label" => trans('website::website.label.custom_page2'), "placeholder" => trans('website::website.placeholder.custom_page2'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'timing_text' => [ "type" => 'text', "label" => trans('website::website.label.timing_text'), "placeholder" => trans('website::website.placeholder.timing_text'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'banner_video' => [ "type" => 'text', "label" => trans('website::website.label.banner_video'), "placeholder" => trans('website::website.placeholder.banner_video'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'is_event_show' => [ "type" => 'numeric', "label" => trans('website::website.label.is_event_show'), "placeholder" => trans('website::website.placeholder.is_event_show'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'PRIMARY' => [ "type" => 'package::package.formcontrols.KEY', "label" => trans('website::website.label.PRIMARY'), "placeholder" => trans('website::website.placeholder.PRIMARY'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }