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' => [ 'name' => [ "type" => 'text', "label" => trans('site::site.label.name'), "placeholder" => trans('site::site.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'address' => [ "type" => 'text', "label" => trans('site::site.label.address'), "placeholder" => trans('site::site.placeholder.address'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'city' => [ "type" => 'text', "label" => trans('site::site.label.city'), "placeholder" => trans('site::site.placeholder.city'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'postcode' => [ "type" => 'text', "label" => trans('site::site.label.postcode'), "placeholder" => trans('site::site.placeholder.postcode'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'latitude' => [ "type" => 'decimal', "label" => trans('site::site.label.latitude'), "placeholder" => trans('site::site.placeholder.latitude'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'longitude' => [ "type" => 'decimal', "label" => trans('site::site.label.longitude'), "placeholder" => trans('site::site.placeholder.longitude'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }