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' => [ 'order_id' => [ "type" => 'numeric', "label" => trans('call::calls.label.order_id'), "placeholder" => trans('call::calls.placeholder.order_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'restaurant_id' => [ "type" => 'numeric', "label" => trans('call::calls.label.restaurant_id'), "placeholder" => trans('call::calls.placeholder.restaurant_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'call_count' => [ "type" => 'numeric', "label" => trans('call::calls.label.call_count'), "placeholder" => trans('call::calls.placeholder.call_count'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'datetime' => [ "type" => 'date_time_picker', "label" => trans('call::calls.label.datetime'), "placeholder" => trans('call::calls.placeholder.datetime'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }