src/Traits/LaratrustTeamTrait.php
public static function bootLaratrustTeamTrait()
    {
        static::deleting(function ($team) {
            if (method_exists($team, 'bootSoftDeletes') && !$team->forceDeleting) {
                return;
            }

            foreach (array_keys(Config::get('laratrust.user_models')) as $key) {
                $team->$key()->sync([]);
            }
        });
    }
public static function bootLaratrustTeamTrait()
    {
        static::deleting(function ($team) {
            if (method_exists($team, 'bootSoftDeletes') && !$team->forceDeleting) {
                return;
            }

            foreach (array_keys(Config::get('laratrust.user_models')) as $key) {
                $team->$key()->sync([]);
            }
        });
    }
public static function bootLaratrustTeamTrait ( ) { static :: deleting ( function ( $ team ) { if ( method_exists ( $ team , 'bootSoftDeletes' ) && ! $ team -> forceDeleting ) { return ; } foreach ( array_keys ( Config :: get ( 'laratrust.user_models' ) ) as $ key ) { $ team -> $ key ( ) -> sync ( [ ] ) ; } } ) ; }
Boots the team model and attaches event listener to
remove the many-to-many records when trying to delete.
Will NOT delete any records if the team model uses soft deletes.

@return void|bool
Boots the team model and attaches event listener to remove the many - to - many records when trying to delete . Will NOT delete any records if the team model uses soft deletes .