public static function boot()
    {
        parent::boot();
        static::deleting(function ($permission) {
            if (!method_exists(config('access.permission'), 'bootSoftDeletes')) {
                $permission->roles()->sync([]);
            }

            return true;
        });
    }
public static function boot()
    {
        parent::boot();
        static::deleting(function ($permission) {
            if (!method_exists(config('access.permission'), 'bootSoftDeletes')) {
                $permission->roles()->sync([]);
            }

            return true;
        });
    }
public static function boot ( ) { parent :: boot ( ) ; static :: deleting ( function ( $ permission ) { if ( ! method_exists ( config ( 'access.permission' ) , 'bootSoftDeletes' ) ) { $ permission -> roles ( ) -> sync ( [ ] ) ; } return true ; } ) ; }
Boot the permission model
Attach event listener to remove the many-to-many records when trying to delete
Will NOT delete any records if the permission model uses soft deletes.

@return void|bool
Boot the permission model Attach event listener to remove the many - to - many records when trying to delete Will NOT delete any records if the permission model uses soft deletes .