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' => [ 'project_id' => [ "type" => 'numeric', "label" => trans('pm::page.label.project_id'), "placeholder" => trans('pm::page.placeholder.project_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'type' => [ "type" => 'text', "label" => trans('pm::page.label.type'), "placeholder" => trans('pm::page.placeholder.type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'title' => [ "type" => 'text', "label" => trans('pm::page.label.title'), "placeholder" => trans('pm::page.placeholder.title'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'content' => [ "type" => 'html_editor', "label" => trans('pm::page.label.content'), "placeholder" => trans('pm::page.placeholder.content'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'files' => [ "type" => 'text', "label" => trans('pm::page.label.files'), "placeholder" => trans('pm::page.placeholder.files'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'url' => [ "type" => 'text', "label" => trans('pm::page.label.url'), "placeholder" => trans('pm::page.placeholder.url'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'created_by' => [ "type" => 'numeric', "label" => trans('pm::page.label.created_by'), "placeholder" => trans('pm::page.placeholder.created_by'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ')' => [ "type" => 'package::package.formcontrols.ON', "label" => trans('pm::page.label.)'), "placeholder" => trans('pm::page.placeholder.)'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }