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' => [ 'company_id' => [ "type" => 'select', "label" => trans('question::question.label.company_id'), "placeholder" => trans('question::question.placeholder.company_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'name' => [ "type" => 'text', "label" => trans('question::question.label.name'), "placeholder" => trans('question::question.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'source' => [ "type" => 'select', "label" => trans('question::question.label.source'), "placeholder" => trans('question::question.placeholder.source'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'category' => [ "type" => 'select', "label" => trans('question::question.label.category'), "placeholder" => trans('question::question.placeholder.category'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'dimensions' => [ "type" => 'text', "label" => trans('question::question.label.dimensions'), "placeholder" => trans('question::question.placeholder.dimensions'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'response_required' => [ "type" => 'numeric', "label" => trans('question::question.label.response_required'), "placeholder" => trans('question::question.placeholder.response_required'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'response_option' => [ "type" => 'numeric', "label" => trans('question::question.label.response_option'), "placeholder" => trans('question::question.placeholder.response_option'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'alt_versions' => [ "type" => 'text', "label" => trans('question::question.label.alt_versions'), "placeholder" => trans('question::question.placeholder.alt_versions'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'tags' => [ "type" => 'text', "label" => trans('question::question.label.tags'), "placeholder" => trans('question::question.placeholder.tags'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'templates' => [ "type" => 'text', "label" => trans('question::question.label.templates'), "placeholder" => trans('question::question.placeholder.templates'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'nodes' => [ "type" => 'text', "label" => trans('question::question.label.nodes'), "placeholder" => trans('question::question.placeholder.nodes'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }