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('lead::lead.label.title'), "placeholder" => trans('lead::lead.placeholder.title'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'name' => [ "type" => 'text', "label" => trans('lead::lead.label.name'), "placeholder" => trans('lead::lead.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'address' => [ "type" => 'text', "label" => trans('lead::lead.label.address'), "placeholder" => trans('lead::lead.placeholder.address'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'representing' => [ "type" => 'text', "label" => trans('lead::lead.label.representing'), "placeholder" => trans('lead::lead.placeholder.representing'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'location' => [ "type" => 'text', "label" => trans('lead::lead.label.location'), "placeholder" => trans('lead::lead.placeholder.location'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'sublocation' => [ "type" => 'text', "label" => trans('lead::lead.label.sublocation'), "placeholder" => trans('lead::lead.placeholder.sublocation'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'property_type' => [ "type" => 'select', "label" => trans('lead::lead.label.property_type'), "placeholder" => trans('lead::lead.placeholder.property_type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'price_range' => [ "type" => 'text', "label" => trans('lead::lead.label.price_range'), "placeholder" => trans('lead::lead.placeholder.price_range'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'bedroom' => [ "type" => 'text', "label" => trans('lead::lead.label.bedroom'), "placeholder" => trans('lead::lead.placeholder.bedroom'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'bathroom' => [ "type" => 'text', "label" => trans('lead::lead.label.bathroom'), "placeholder" => trans('lead::lead.placeholder.bathroom'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }