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('project::project.label.name'), "placeholder" => trans('project::project.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'customer_id' => [ "type" => 'numeric', "label" => trans('project::project.label.customer_id'), "placeholder" => trans('project::project.placeholder.customer_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'images' => [ "type" => 'text', "label" => trans('project::project.label.images'), "placeholder" => trans('project::project.placeholder.images'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'duration' => [ "type" => 'text', "label" => trans('project::project.label.duration'), "placeholder" => trans('project::project.placeholder.duration'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'description' => [ "type" => 'text', "label" => trans('project::project.label.description'), "placeholder" => trans('project::project.placeholder.description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'modules' => [ "type" => 'text', "label" => trans('project::project.label.modules'), "placeholder" => trans('project::project.placeholder.modules'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'activities' => [ "type" => 'text', "label" => trans('project::project.label.activities'), "placeholder" => trans('project::project.placeholder.activities'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }