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('discount::discount.label.restaurant_id'), "placeholder" => trans('discount::discount.placeholder.restaurant_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'menu_id' => [ "type" => 'numeric', "label" => trans('discount::discount.label.menu_id'), "placeholder" => trans('discount::discount.placeholder.menu_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'discount_percentage' => [ "type" => 'numeric', "label" => trans('discount::discount.label.discount_percentage'), "placeholder" => trans('discount::discount.placeholder.discount_percentage'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'start_date' => [ "type" => 'date_picker', "label" => trans('discount::discount.label.start_date'), "placeholder" => trans('discount::discount.placeholder.start_date'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'end_date' => [ "type" => 'date_picker', "label" => trans('discount::discount.label.end_date'), "placeholder" => trans('discount::discount.placeholder.end_date'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'status' => [ "type" => 'text', "label" => trans('discount::discount.label.status'), "placeholder" => trans('discount::discount.placeholder.status'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'notification_status' => [ "type" => 'text', "label" => trans('discount::discount.label.notification_status'), "placeholder" => trans('discount::discount.placeholder.notification_status'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }