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