Code Duplication    Length = 10-10 lines in 3 locations

src/Traits/EntrustRoleTrait.php 3 locations

@@ 34-43 (lines=10) @@
31
        }
32
    }
33
34
    public function save(array $options = [])
35
    {   //both inserts and updates
36
        if (!parent::save($options)) {
37
            return false;
38
        }
39
        if (Cache::getStore() instanceof TaggableStore) {
40
            Cache::tags(Config::get('admin.permission_role_table'))->flush();
41
        }
42
        return true;
43
    }
44
45
    public function delete(array $options = [])
46
    {   //soft or hard
@@ 45-54 (lines=10) @@
42
        return true;
43
    }
44
45
    public function delete(array $options = [])
46
    {   //soft or hard
47
        if (!parent::delete($options)) {
48
            return false;
49
        }
50
        if (Cache::getStore() instanceof TaggableStore) {
51
            Cache::tags(Config::get('admin.permission_role_table'))->flush();
52
        }
53
        return true;
54
    }
55
56
    public function restore()
57
    {   //soft delete undo's
@@ 56-65 (lines=10) @@
53
        return true;
54
    }
55
56
    public function restore()
57
    {   //soft delete undo's
58
        if (!parent::restore()) {
59
            return false;
60
        }
61
        if (Cache::getStore() instanceof TaggableStore) {
62
            Cache::tags(Config::get('admin.permission_role_table'))->flush();
63
        }
64
        return true;
65
    }
66
67
    /**
68
     * Many-to-Many relations with the user model.