Code Duplication    Length = 14-14 lines in 2 locations

src/Traits/EntrustPermissionTrait.php 1 location

@@ 38-51 (lines=14) @@
35
     *
36
     * @return void|bool
37
     */
38
    public static function boot()
39
    {
40
        parent::boot();
41
42
        static::deleting(function ($permission) {
43
            if (!method_exists(Config::get('admin.permission'),
44
                'bootSoftDeletes')
45
            ) {
46
                $permission->roles()->sync([]);
47
            }
48
49
            return true;
50
        });
51
    }
52
}
53

src/Traits/EntrustUserTrait.php 1 location

@@ 79-92 (lines=14) @@
76
     *
77
     * @return void|bool
78
     */
79
    public static function boot()
80
    {
81
        parent::boot();
82
83
        static::deleting(function ($user) {
84
            if (!method_exists(Config::get('admin.user'),
85
                'bootSoftDeletes')
86
            ) {
87
                $user->roles()->sync([]);
88
            }
89
90
            return true;
91
        });
92
    }
93
94
    /**
95
     * Checks if the user has a role by its name.