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' => [ 'team_id' => [ "type" => 'numeric', "label" => trans('team::user.label.team_id'), "placeholder" => trans('team::user.placeholder.team_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'roles' => [ "type" => 'select', "label" => trans('team::user.label.roles'), "placeholder" => trans('team::user.placeholder.roles'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'position' => [ "type" => 'text', "label" => trans('team::user.label.position'), "placeholder" => trans('team::user.placeholder.position'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'settings' => [ "type" => 'text', "label" => trans('team::user.label.settings'), "placeholder" => trans('team::user.placeholder.settings'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'expires_on' => [ "type" => 'date_picker', "label" => trans('team::user.label.expires_on'), "placeholder" => trans('team::user.placeholder.expires_on'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'created_by' => [ "type" => 'numeric', "label" => trans('team::user.label.created_by'), "placeholder" => trans('team::user.placeholder.created_by'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }