Code Duplication    Length = 5-7 lines in 2 locations

src/Repositories/Role/RoleRepository.php 2 locations

@@ 80-84 (lines=5) @@
77
        }
78
79
        // Convert the checkbox values of "1" to true, so permission checking works with Sentinel.
80
        if (isset($data['permissions'])) {
81
            foreach ($data['permissions'] as $permission => $value) {
82
                $data['permissions'][$permission] = true;
83
            }
84
        }
85
86
        try {
87
            $role = $this->sentinel->getRoleRepository()
@@ 123-129 (lines=7) @@
120
        }
121
122
        // Convert the checkbox values of "1" to true, so permission checking works with Sentinel.
123
        if (isset($data['permissions'])) {
124
            foreach ($data['permissions'] as $permission => $value) {
125
                $data['permissions'][$permission] = true;
126
            }
127
        } else {
128
            $data['permissions'] = [];
129
        }
130
131
        $role->name        = $data['name'];
132
        $role->slug        = $data['slug'];