Code Duplication    Length = 7-7 lines in 2 locations

src/Traits/RefreshCache.php 2 locations

@@ 9-15 (lines=7) @@
6
{
7
    public static function bootRefreshCache()
8
    {
9
        static::saved(function () {
10
            if (auth()->check()) {
11
                auth()->user()->load('roles');
12
            }
13
14
            app('cache.store')->forget(config('acl.cache.key', 'permissions.policies'));
15
        });
16
17
        static::deleted(function () {
18
            if (auth()->check()) {
@@ 17-23 (lines=7) @@
14
            app('cache.store')->forget(config('acl.cache.key', 'permissions.policies'));
15
        });
16
17
        static::deleted(function () {
18
            if (auth()->check()) {
19
                auth()->user()->load('roles');
20
            }
21
22
            app('cache.store')->forget(config('acl.cache.key', 'permissions.policies'));
23
        });
24
    }
25
}
26