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' => [ 'id' => [ "type" => 'numeric', "label" => trans('example::master.label.id'), "placeholder" => trans('example::master.placeholder.id'), "rules" => 'required', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'parent_id' => [ "type" => 'numeric', "label" => trans('example::master.label.parent_id'), "placeholder" => trans('example::master.placeholder.parent_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'type' => [ "type" => 'text', "label" => trans('example::master.label.type'), "placeholder" => trans('example::master.placeholder.type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'name' => [ "type" => 'text', "label" => trans('example::master.label.name'), "placeholder" => trans('example::master.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'code' => [ "type" => 'text', "label" => trans('example::master.label.code'), "placeholder" => trans('example::master.placeholder.code'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'amount' => [ "type" => 'decimal', "label" => trans('example::master.label.amount'), "placeholder" => trans('example::master.placeholder.amount'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'abbr' => [ "type" => 'text', "label" => trans('example::master.label.abbr'), "placeholder" => trans('example::master.placeholder.abbr'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'description' => [ "type" => 'text', "label" => trans('example::master.label.description'), "placeholder" => trans('example::master.placeholder.description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'icon' => [ "type" => 'text', "label" => trans('example::master.label.icon'), "placeholder" => trans('example::master.placeholder.icon'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'image' => [ "type" => 'text', "label" => trans('example::master.label.image'), "placeholder" => trans('example::master.placeholder.image'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'images' => [ "type" => 'text', "label" => trans('example::master.label.images'), "placeholder" => trans('example::master.placeholder.images'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'file' => [ "type" => 'text', "label" => trans('example::master.label.file'), "placeholder" => trans('example::master.placeholder.file'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'order' => [ "type" => 'numeric', "label" => trans('example::master.label.order'), "placeholder" => trans('example::master.placeholder.order'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'extras' => [ "type" => 'text', "label" => trans('example::master.label.extras'), "placeholder" => trans('example::master.placeholder.extras'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }