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