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('contacts::contacts.label.title'), "placeholder" => trans('contacts::contacts.placeholder.title'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'first_name' => [ "type" => 'text', "label" => trans('contacts::contacts.label.first_name'), "placeholder" => trans('contacts::contacts.placeholder.first_name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'last_name' => [ "type" => 'text', "label" => trans('contacts::contacts.label.last_name'), "placeholder" => trans('contacts::contacts.placeholder.last_name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'dob' => [ "type" => 'date_picker', "label" => trans('contacts::contacts.label.dob'), "placeholder" => trans('contacts::contacts.placeholder.dob'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'nationality' => [ "type" => 'text', "label" => trans('contacts::contacts.label.nationality'), "placeholder" => trans('contacts::contacts.placeholder.nationality'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'religion' => [ "type" => 'text', "label" => trans('contacts::contacts.label.religion'), "placeholder" => trans('contacts::contacts.placeholder.religion'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'assigned_to' => [ "type" => 'text', "label" => trans('contacts::contacts.label.assigned_to'), "placeholder" => trans('contacts::contacts.placeholder.assigned_to'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'phone' => [ "type" => 'text', "label" => trans('contacts::contacts.label.phone'), "placeholder" => trans('contacts::contacts.placeholder.phone'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'mobile' => [ "type" => 'text', "label" => trans('contacts::contacts.label.mobile'), "placeholder" => trans('contacts::contacts.placeholder.mobile'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'fax' => [ "type" => 'text', "label" => trans('contacts::contacts.label.fax'), "placeholder" => trans('contacts::contacts.placeholder.fax'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'email' => [ "type" => 'text', "label" => trans('contacts::contacts.label.email'), "placeholder" => trans('contacts::contacts.placeholder.email'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'address_line1' => [ "type" => 'text', "label" => trans('contacts::contacts.label.address_line1'), "placeholder" => trans('contacts::contacts.placeholder.address_line1'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'address_line2' => [ "type" => 'text', "label" => trans('contacts::contacts.label.address_line2'), "placeholder" => trans('contacts::contacts.placeholder.address_line2'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'zipcode' => [ "type" => 'numeric', "label" => trans('contacts::contacts.label.zipcode'), "placeholder" => trans('contacts::contacts.placeholder.zipcode'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'city' => [ "type" => 'text', "label" => trans('contacts::contacts.label.city'), "placeholder" => trans('contacts::contacts.placeholder.city'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'state' => [ "type" => 'text', "label" => trans('contacts::contacts.label.state'), "placeholder" => trans('contacts::contacts.placeholder.state'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'country' => [ "type" => 'text', "label" => trans('contacts::contacts.label.country'), "placeholder" => trans('contacts::contacts.placeholder.country'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'company' => [ "type" => 'text', "label" => trans('contacts::contacts.label.company'), "placeholder" => trans('contacts::contacts.placeholder.company'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'company_website' => [ "type" => 'text', "label" => trans('contacts::contacts.label.company_website'), "placeholder" => trans('contacts::contacts.placeholder.company_website'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'designation' => [ "type" => 'text', "label" => trans('contacts::contacts.label.designation'), "placeholder" => trans('contacts::contacts.placeholder.designation'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'facebook' => [ "type" => 'text', "label" => trans('contacts::contacts.label.facebook'), "placeholder" => trans('contacts::contacts.placeholder.facebook'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'twitter' => [ "type" => 'text', "label" => trans('contacts::contacts.label.twitter'), "placeholder" => trans('contacts::contacts.placeholder.twitter'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'linkedin' => [ "type" => 'text', "label" => trans('contacts::contacts.label.linkedin'), "placeholder" => trans('contacts::contacts.placeholder.linkedin'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'documents' => [ "type" => 'text', "label" => trans('contacts::contacts.label.documents'), "placeholder" => trans('contacts::contacts.placeholder.documents'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }