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' => [ 'task' => [ "type" => 'text', "label" => trans('campaign::campaign_task.label.task'), "placeholder" => trans('campaign::campaign_task.placeholder.task'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'task_type' => [ "type" => 'text', "label" => trans('campaign::campaign_task.label.task_type'), "placeholder" => trans('campaign::campaign_task.placeholder.task_type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'campaign_stage' => [ "type" => 'text', "label" => trans('campaign::campaign_task.label.campaign_stage'), "placeholder" => trans('campaign::campaign_task.placeholder.campaign_stage'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'booking_variant' => [ "type" => 'text', "label" => trans('campaign::campaign_task.label.booking_variant'), "placeholder" => trans('campaign::campaign_task.placeholder.booking_variant'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'information' => [ "type" => 'text', "label" => trans('campaign::campaign_task.label.information'), "placeholder" => trans('campaign::campaign_task.placeholder.information'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'task_from' => [ "type" => 'text', "label" => trans('campaign::campaign_task.label.task_from'), "placeholder" => trans('campaign::campaign_task.placeholder.task_from'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'task_for' => [ "type" => 'text', "label" => trans('campaign::campaign_task.label.task_for'), "placeholder" => trans('campaign::campaign_task.placeholder.task_for'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'date' => [ "type" => 'date_picker', "label" => trans('campaign::campaign_task.label.date'), "placeholder" => trans('campaign::campaign_task.placeholder.date'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'done_on' => [ "type" => 'date_picker', "label" => trans('campaign::campaign_task.label.done_on'), "placeholder" => trans('campaign::campaign_task.placeholder.done_on'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }