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' => [ 'ref' => [ "type" => 'text', "label" => trans('campaigns::campaign_call.label.ref'), "placeholder" => trans('campaigns::campaign_call.placeholder.ref'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'agent_id' => [ "type" => 'numeric', "label" => trans('campaigns::campaign_call.label.agent_id'), "placeholder" => trans('campaigns::campaign_call.placeholder.agent_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'assigned_on' => [ "type" => 'date_picker', "label" => trans('campaigns::campaign_call.label.assigned_on'), "placeholder" => trans('campaigns::campaign_call.placeholder.assigned_on'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'called_on' => [ "type" => 'date_picker', "label" => trans('campaigns::campaign_call.label.called_on'), "placeholder" => trans('campaigns::campaign_call.placeholder.called_on'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'category_id' => [ "type" => 'numeric', "label" => trans('campaigns::campaign_call.label.category_id'), "placeholder" => trans('campaigns::campaign_call.placeholder.category_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'city_id' => [ "type" => 'numeric', "label" => trans('campaigns::campaign_call.label.city_id'), "placeholder" => trans('campaigns::campaign_call.placeholder.city_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'location_id' => [ "type" => 'numeric', "label" => trans('campaigns::campaign_call.label.location_id'), "placeholder" => trans('campaigns::campaign_call.placeholder.location_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'sublocation_id' => [ "type" => 'numeric', "label" => trans('campaigns::campaign_call.label.sublocation_id'), "placeholder" => trans('campaigns::campaign_call.placeholder.sublocation_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'type' => [ "type" => 'text', "label" => trans('campaigns::campaign_call.label.type'), "placeholder" => trans('campaigns::campaign_call.placeholder.type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'area' => [ "type" => 'text', "label" => trans('campaigns::campaign_call.label.area'), "placeholder" => trans('campaigns::campaign_call.placeholder.area'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'copied' => [ "type" => 'radios', "label" => trans('campaigns::campaign_call.label.copied'), "placeholder" => trans('campaigns::campaign_call.placeholder.copied'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'hot' => [ "type" => 'numeric', "label" => trans('campaigns::campaign_call.label.hot'), "placeholder" => trans('campaigns::campaign_call.placeholder.hot'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'sub_status' => [ "type" => 'text', "label" => trans('campaigns::campaign_call.label.sub_status'), "placeholder" => trans('campaigns::campaign_call.placeholder.sub_status'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'nationality' => [ "type" => 'text', "label" => trans('campaigns::campaign_call.label.nationality'), "placeholder" => trans('campaigns::campaign_call.placeholder.nationality'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'unit' => [ "type" => 'text', "label" => trans('campaigns::campaign_call.label.unit'), "placeholder" => trans('campaigns::campaign_call.placeholder.unit'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'priority' => [ "type" => 'text', "label" => trans('campaigns::campaign_call.label.priority'), "placeholder" => trans('campaigns::campaign_call.placeholder.priority'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'name' => [ "type" => 'text', "label" => trans('campaigns::campaign_call.label.name'), "placeholder" => trans('campaigns::campaign_call.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'mobile' => [ "type" => 'text', "label" => trans('campaigns::campaign_call.label.mobile'), "placeholder" => trans('campaigns::campaign_call.placeholder.mobile'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'phone' => [ "type" => 'text', "label" => trans('campaigns::campaign_call.label.phone'), "placeholder" => trans('campaigns::campaign_call.placeholder.phone'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'email' => [ "type" => 'text', "label" => trans('campaigns::campaign_call.label.email'), "placeholder" => trans('campaigns::campaign_call.placeholder.email'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'source_id' => [ "type" => 'numeric', "label" => trans('campaigns::campaign_call.label.source_id'), "placeholder" => trans('campaigns::campaign_call.placeholder.source_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'other_source' => [ "type" => 'text', "label" => trans('campaigns::campaign_call.label.other_source'), "placeholder" => trans('campaigns::campaign_call.placeholder.other_source'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'reminder' => [ "type" => 'date_picker', "label" => trans('campaigns::campaign_call.label.reminder'), "placeholder" => trans('campaigns::campaign_call.placeholder.reminder'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'notes' => [ "type" => 'text', "label" => trans('campaigns::campaign_call.label.notes'), "placeholder" => trans('campaigns::campaign_call.placeholder.notes'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'note' => [ "type" => 'text', "label" => trans('campaigns::campaign_call.label.note'), "placeholder" => trans('campaigns::campaign_call.placeholder.note'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'created_by' => [ "type" => 'numeric', "label" => trans('campaigns::campaign_call.label.created_by'), "placeholder" => trans('campaigns::campaign_call.placeholder.created_by'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }