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' => [ 'documentable_id' => [ "type" => 'numeric', "label" => trans('document::documents.label.documentable_id'), "placeholder" => trans('document::documents.placeholder.documentable_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'documentable_type' => [ "type" => 'text', "label" => trans('document::documents.label.documentable_type'), "placeholder" => trans('document::documents.placeholder.documentable_type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'type' => [ "type" => 'text', "label" => trans('document::documents.label.type'), "placeholder" => trans('document::documents.placeholder.type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'title' => [ "type" => 'text', "label" => trans('document::documents.label.title'), "placeholder" => trans('document::documents.placeholder.title'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'description' => [ "type" => 'text', "label" => trans('document::documents.label.description'), "placeholder" => trans('document::documents.placeholder.description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'expiry_date' => [ "type" => 'date_picker', "label" => trans('document::documents.label.expiry_date'), "placeholder" => trans('document::documents.placeholder.expiry_date'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'files' => [ "type" => 'text', "label" => trans('document::documents.label.files'), "placeholder" => trans('document::documents.placeholder.files'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }