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