Code Duplication    Length = 5-5 lines in 2 locations

src/Repositories/Role/RoleRepository.php 2 locations

@@ 106-110 (lines=5) @@
103
            throw new RolesException(trans('dashboard::dashboard.errors.role.found'));
104
        }
105
106
        if ($role->name != $data['name']) {
107
            $this->rules['name'] = 'required|alpha_dash|unique:roles';
108
        } else {
109
            $this->rules['name'] = 'required|alpha_dash';
110
        }
111
112
        if ($role->slug != $data['slug']) {
113
            $this->rules['slug'] = 'required|alpha_dash|unique:roles';
@@ 112-116 (lines=5) @@
109
            $this->rules['name'] = 'required|alpha_dash';
110
        }
111
112
        if ($role->slug != $data['slug']) {
113
            $this->rules['slug'] = 'required|alpha_dash|unique:roles';
114
        } else {
115
            $this->rules['slug'] = 'required|alpha_dash';
116
        }
117
118
        if ($validate) {
119
            $this->validate($data);