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' => [ 'asset_id' => [ "type" => 'numeric', "label" => trans('plan::plan.label.asset_id'), "placeholder" => trans('plan::plan.placeholder.asset_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'name' => [ "type" => 'text', "label" => trans('plan::plan.label.name'), "placeholder" => trans('plan::plan.placeholder.name'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'departure_location_id' => [ "type" => 'numeric', "label" => trans('plan::plan.label.departure_location_id'), "placeholder" => trans('plan::plan.placeholder.departure_location_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'arrival_location_id' => [ "type" => 'numeric', "label" => trans('plan::plan.label.arrival_location_id'), "placeholder" => trans('plan::plan.placeholder.arrival_location_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'waypoint' => [ "type" => 'html_editor', "label" => trans('plan::plan.label.waypoint'), "placeholder" => trans('plan::plan.placeholder.waypoint'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'schedule_time' => [ "type" => 'date_time_picker', "label" => trans('plan::plan.label.schedule_time'), "placeholder" => trans('plan::plan.placeholder.schedule_time'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'status' => [ "type" => 'select', "label" => trans('plan::plan.label.status'), "placeholder" => trans('plan::plan.placeholder.status'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }