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' => [ 'title' => [ "type" => 'text', "label" => trans('opportunity::opportunities.label.title'), "placeholder" => trans('opportunity::opportunities.placeholder.title'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'first_name' => [ "type" => 'text', "label" => trans('opportunity::opportunities.label.first_name'), "placeholder" => trans('opportunity::opportunities.placeholder.first_name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'last_name' => [ "type" => 'text', "label" => trans('opportunity::opportunities.label.last_name'), "placeholder" => trans('opportunity::opportunities.placeholder.last_name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'email' => [ "type" => 'text', "label" => trans('opportunity::opportunities.label.email'), "placeholder" => trans('opportunity::opportunities.placeholder.email'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'phone' => [ "type" => 'numeric', "label" => trans('opportunity::opportunities.label.phone'), "placeholder" => trans('opportunity::opportunities.placeholder.phone'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'account_name' => [ "type" => 'text', "label" => trans('opportunity::opportunities.label.account_name'), "placeholder" => trans('opportunity::opportunities.placeholder.account_name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'website' => [ "type" => 'text', "label" => trans('opportunity::opportunities.label.website'), "placeholder" => trans('opportunity::opportunities.placeholder.website'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'address_line1' => [ "type" => 'text', "label" => trans('opportunity::opportunities.label.address_line1'), "placeholder" => trans('opportunity::opportunities.placeholder.address_line1'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'address_line2' => [ "type" => 'text', "label" => trans('opportunity::opportunities.label.address_line2'), "placeholder" => trans('opportunity::opportunities.placeholder.address_line2'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'city' => [ "type" => 'text', "label" => trans('opportunity::opportunities.label.city'), "placeholder" => trans('opportunity::opportunities.placeholder.city'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'state' => [ "type" => 'text', "label" => trans('opportunity::opportunities.label.state'), "placeholder" => trans('opportunity::opportunities.placeholder.state'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'country' => [ "type" => 'text', "label" => trans('opportunity::opportunities.label.country'), "placeholder" => trans('opportunity::opportunities.placeholder.country'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'zipcode' => [ "type" => 'numeric', "label" => trans('opportunity::opportunities.label.zipcode'), "placeholder" => trans('opportunity::opportunities.placeholder.zipcode'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'opportunity_title' => [ "type" => 'text', "label" => trans('opportunity::opportunities.label.opportunity_title'), "placeholder" => trans('opportunity::opportunities.placeholder.opportunity_title'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'finance' => [ "type" => 'text', "label" => trans('opportunity::opportunities.label.finance'), "placeholder" => trans('opportunity::opportunities.placeholder.finance'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'industry' => [ "type" => 'text', "label" => trans('opportunity::opportunities.label.industry'), "placeholder" => trans('opportunity::opportunities.placeholder.industry'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'hot_opportunity' => [ "type" => 'text', "label" => trans('opportunity::opportunities.label.hot_opportunity'), "placeholder" => trans('opportunity::opportunities.placeholder.hot_opportunity'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'priority' => [ "type" => 'text', "label" => trans('opportunity::opportunities.label.priority'), "placeholder" => trans('opportunity::opportunities.placeholder.priority'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'source' => [ "type" => 'text', "label" => trans('opportunity::opportunities.label.source'), "placeholder" => trans('opportunity::opportunities.placeholder.source'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'agent1' => [ "type" => 'text', "label" => trans('opportunity::opportunities.label.agent1'), "placeholder" => trans('opportunity::opportunities.placeholder.agent1'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'lead_amount' => [ "type" => 'numeric', "label" => trans('opportunity::opportunities.label.lead_amount'), "placeholder" => trans('opportunity::opportunities.placeholder.lead_amount'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'campaign' => [ "type" => 'text', "label" => trans('opportunity::opportunities.label.campaign'), "placeholder" => trans('opportunity::opportunities.placeholder.campaign'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'created_by' => [ "type" => 'text', "label" => trans('opportunity::opportunities.label.created_by'), "placeholder" => trans('opportunity::opportunities.placeholder.created_by'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'description' => [ "type" => 'text', "label" => trans('opportunity::opportunities.label.description'), "placeholder" => trans('opportunity::opportunities.placeholder.description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'property_requirements' => [ "type" => 'text', "label" => trans('opportunity::opportunities.label.property_requirements'), "placeholder" => trans('opportunity::opportunities.placeholder.property_requirements'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }