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' => [ 'ref' => [ "type" => 'text', "label" => trans('company::subdivisions.label.ref'), "placeholder" => trans('company::subdivisions.placeholder.ref'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'branch_id' => [ "type" => 'numeric', "label" => trans('company::subdivisions.label.branch_id'), "placeholder" => trans('company::subdivisions.placeholder.branch_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'department_id' => [ "type" => 'numeric', "label" => trans('company::subdivisions.label.department_id'), "placeholder" => trans('company::subdivisions.placeholder.department_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'division_id' => [ "type" => 'numeric', "label" => trans('company::subdivisions.label.division_id'), "placeholder" => trans('company::subdivisions.placeholder.division_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'name' => [ "type" => 'text', "label" => trans('company::subdivisions.label.name'), "placeholder" => trans('company::subdivisions.placeholder.name'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'description' => [ "type" => 'text', "label" => trans('company::subdivisions.label.description'), "placeholder" => trans('company::subdivisions.placeholder.description'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'customer_type' => [ "type" => 'text', "label" => trans('company::subdivisions.label.customer_type'), "placeholder" => trans('company::subdivisions.placeholder.customer_type'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'manager_id' => [ "type" => 'numeric', "label" => trans('company::subdivisions.label.manager_id'), "placeholder" => trans('company::subdivisions.placeholder.manager_id'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'notification_to' => [ "type" => 'numeric', "label" => trans('company::subdivisions.label.notification_to'), "placeholder" => trans('company::subdivisions.placeholder.notification_to'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], 'subdivision_users' => [ "type" => 'text', "label" => trans('company::subdivisions.label.subdivision_users'), "placeholder" => trans('company::subdivisions.placeholder.subdivision_users'), "rules" => '', "group" => "main", "section" => "first", "attributes" => [ 'wrapper' => [], "label" => [], "input" => [], ], ], ] ); } }