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('reports::report.label.restaurant_id'), "placeholder" => trans('reports::report.placeholder.restaurant_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'name' => [ "type" => 'text', "label" => trans('reports::report.label.name'), "placeholder" => trans('reports::report.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'original_total' => [ "type" => 'numeric', "label" => trans('reports::report.label.original_total'), "placeholder" => trans('reports::report.placeholder.original_total'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'corrected_total' => [ "type" => 'numeric', "label" => trans('reports::report.label.corrected_total'), "placeholder" => trans('reports::report.placeholder.corrected_total'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'refund_total' => [ "type" => 'numeric', "label" => trans('reports::report.label.refund_total'), "placeholder" => trans('reports::report.placeholder.refund_total'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'order_count' => [ "type" => 'numeric', "label" => trans('reports::report.label.order_count'), "placeholder" => trans('reports::report.placeholder.order_count'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'tip_total' => [ "type" => 'numeric', "label" => trans('reports::report.label.tip_total'), "placeholder" => trans('reports::report.placeholder.tip_total'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'foodsales' => [ "type" => 'numeric', "label" => trans('reports::report.label.foodsales'), "placeholder" => trans('reports::report.placeholder.foodsales'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'customer_fee' => [ "type" => 'numeric', "label" => trans('reports::report.label.customer_fee'), "placeholder" => trans('reports::report.placeholder.customer_fee'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'eatery_fee' => [ "type" => 'numeric', "label" => trans('reports::report.label.eatery_fee'), "placeholder" => trans('reports::report.placeholder.eatery_fee'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'postmates' => [ "type" => 'numeric', "label" => trans('reports::report.label.postmates'), "placeholder" => trans('reports::report.placeholder.postmates'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'orders_date' => [ "type" => 'date_time_picker', "label" => trans('reports::report.label.orders_date'), "placeholder" => trans('reports::report.placeholder.orders_date'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'total_visitors' => [ "type" => 'numeric', "label" => trans('reports::report.label.total_visitors'), "placeholder" => trans('reports::report.placeholder.total_visitors'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'total_pageview' => [ "type" => 'numeric', "label" => trans('reports::report.label.total_pageview'), "placeholder" => trans('reports::report.placeholder.total_pageview'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'mobile_view' => [ "type" => 'numeric', "label" => trans('reports::report.label.mobile_view'), "placeholder" => trans('reports::report.placeholder.mobile_view'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'desktop_view' => [ "type" => 'numeric', "label" => trans('reports::report.label.desktop_view'), "placeholder" => trans('reports::report.placeholder.desktop_view'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'visitors_count' => [ "type" => 'numeric', "label" => trans('reports::report.label.visitors_count'), "placeholder" => trans('reports::report.placeholder.visitors_count'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'PRIMARY' => [ "type" => 'package::package.formcontrols.KEY', "label" => trans('reports::report.label.PRIMARY'), "placeholder" => trans('reports::report.placeholder.PRIMARY'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }