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' => [ 'media_id' => [ "type" => 'numeric', "label" => trans('contact::contact.label.media_id'), "placeholder" => trans('contact::contact.placeholder.media_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'title' => [ "type" => 'text', "label" => trans('contact::contact.label.title'), "placeholder" => trans('contact::contact.placeholder.title'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'fname' => [ "type" => 'text', "label" => trans('contact::contact.label.fname'), "placeholder" => trans('contact::contact.placeholder.fname'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'lname' => [ "type" => 'text', "label" => trans('contact::contact.label.lname'), "placeholder" => trans('contact::contact.placeholder.lname'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'designation' => [ "type" => 'text', "label" => trans('contact::contact.label.designation'), "placeholder" => trans('contact::contact.placeholder.designation'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'phone' => [ "type" => 'text', "label" => trans('contact::contact.label.phone'), "placeholder" => trans('contact::contact.placeholder.phone'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'email' => [ "type" => 'text', "label" => trans('contact::contact.label.email'), "placeholder" => trans('contact::contact.placeholder.email'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'contact_region' => [ "type" => 'text', "label" => trans('contact::contact.label.contact_region'), "placeholder" => trans('contact::contact.placeholder.contact_region'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'contactfor' => [ "type" => 'text', "label" => trans('contact::contact.label.contactfor'), "placeholder" => trans('contact::contact.placeholder.contactfor'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'restriction' => [ "type" => 'text', "label" => trans('contact::contact.label.restriction'), "placeholder" => trans('contact::contact.placeholder.restriction'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'image' => [ "type" => 'text', "label" => trans('contact::contact.label.image'), "placeholder" => trans('contact::contact.placeholder.image'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }