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' => [ 'imo_number' => [ "type" => 'text', "label" => trans('form::forms.label.imo_number'), "placeholder" => trans('form::forms.placeholder.imo_number'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'company_name' => [ "type" => 'text', "label" => trans('form::forms.label.company_name'), "placeholder" => trans('form::forms.placeholder.company_name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'contact_details' => [ "type" => 'text', "label" => trans('form::forms.label.contact_details'), "placeholder" => trans('form::forms.placeholder.contact_details'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'weather' => [ "type" => 'text', "label" => trans('form::forms.label.weather'), "placeholder" => trans('form::forms.placeholder.weather'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'visibility' => [ "type" => 'select', "label" => trans('form::forms.label.visibility'), "placeholder" => trans('form::forms.placeholder.visibility'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'vessel_activity' => [ "type" => 'text', "label" => trans('form::forms.label.vessel_activity'), "placeholder" => trans('form::forms.placeholder.vessel_activity'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'passenger' => [ "type" => 'numeric', "label" => trans('form::forms.label.passenger'), "placeholder" => trans('form::forms.placeholder.passenger'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'others' => [ "type" => 'numeric', "label" => trans('form::forms.label.others'), "placeholder" => trans('form::forms.placeholder.others'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'pilot_board' => [ "type" => 'select', "label" => trans('form::forms.label.pilot_board'), "placeholder" => trans('form::forms.placeholder.pilot_board'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'cargo_board' => [ "type" => 'select', "label" => trans('form::forms.label.cargo_board'), "placeholder" => trans('form::forms.placeholder.cargo_board'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'cargo_type' => [ "type" => 'text', "label" => trans('form::forms.label.cargo_type'), "placeholder" => trans('form::forms.placeholder.cargo_type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'consequences' => [ "type" => 'select', "label" => trans('form::forms.label.consequences'), "placeholder" => trans('form::forms.placeholder.consequences'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'other_consequences' => [ "type" => 'text', "label" => trans('form::forms.label.other_consequences'), "placeholder" => trans('form::forms.placeholder.other_consequences'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'description' => [ "type" => 'text', "label" => trans('form::forms.label.description'), "placeholder" => trans('form::forms.placeholder.description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'happened_desc' => [ "type" => 'text', "label" => trans('form::forms.label.happened_desc'), "placeholder" => trans('form::forms.placeholder.happened_desc'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'prevent_desc' => [ "type" => 'text', "label" => trans('form::forms.label.prevent_desc'), "placeholder" => trans('form::forms.placeholder.prevent_desc'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'person_name' => [ "type" => 'text', "label" => trans('form::forms.label.person_name'), "placeholder" => trans('form::forms.placeholder.person_name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'person_role' => [ "type" => 'text', "label" => trans('form::forms.label.person_role'), "placeholder" => trans('form::forms.placeholder.person_role'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'person_phone' => [ "type" => 'text', "label" => trans('form::forms.label.person_phone'), "placeholder" => trans('form::forms.placeholder.person_phone'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'form_copy' => [ "type" => 'select', "label" => trans('form::forms.label.form_copy'), "placeholder" => trans('form::forms.placeholder.form_copy'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'files' => [ "type" => 'images', "label" => trans('form::forms.label.files'), "placeholder" => trans('form::forms.placeholder.files'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'no_of_people' => [ "type" => 'numeric', "label" => trans('form::forms.label.no_of_people'), "placeholder" => trans('form::forms.placeholder.no_of_people'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }