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::contact.label.title'), "placeholder" => trans('contact::contact.placeholder.title'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'company' => [ "type" => 'text', "label" => trans('contact::contact.label.company'), "placeholder" => trans('contact::contact.placeholder.company'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'surname' => [ "type" => 'text', "label" => trans('contact::contact.label.surname'), "placeholder" => trans('contact::contact.placeholder.surname'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'name' => [ "type" => 'text', "label" => trans('contact::contact.label.name'), "placeholder" => trans('contact::contact.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'category' => [ "type" => 'text', "label" => trans('contact::contact.label.category'), "placeholder" => trans('contact::contact.placeholder.category'), "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" => [], ], ], 'mobile' => [ "type" => 'text', "label" => trans('contact::contact.label.mobile'), "placeholder" => trans('contact::contact.placeholder.mobile'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'fax' => [ "type" => 'text', "label" => trans('contact::contact.label.fax'), "placeholder" => trans('contact::contact.placeholder.fax'), "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" => [], ], ], 'website' => [ "type" => 'text', "label" => trans('contact::contact.label.website'), "placeholder" => trans('contact::contact.placeholder.website'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'country_id' => [ "type" => 'numeric', "label" => trans('contact::contact.label.country_id'), "placeholder" => trans('contact::contact.placeholder.country_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'state_id' => [ "type" => 'numeric', "label" => trans('contact::contact.label.state_id'), "placeholder" => trans('contact::contact.placeholder.state_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'city_id' => [ "type" => 'numeric', "label" => trans('contact::contact.label.city_id'), "placeholder" => trans('contact::contact.placeholder.city_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'zipcode' => [ "type" => 'numeric', "label" => trans('contact::contact.label.zipcode'), "placeholder" => trans('contact::contact.placeholder.zipcode'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'street' => [ "type" => 'text', "label" => trans('contact::contact.label.street'), "placeholder" => trans('contact::contact.placeholder.street'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'street_no' => [ "type" => 'numeric', "label" => trans('contact::contact.label.street_no'), "placeholder" => trans('contact::contact.placeholder.street_no'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'tags' => [ "type" => 'text', "label" => trans('contact::contact.label.tags'), "placeholder" => trans('contact::contact.placeholder.tags'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'content' => [ "type" => 'text', "label" => trans('contact::contact.label.content'), "placeholder" => trans('contact::contact.placeholder.content'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'images' => [ "type" => 'images', "label" => trans('contact::contact.label.images'), "placeholder" => trans('contact::contact.placeholder.images'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }