src/Traits/LaratrustUserTrait.php
public function rolesTeams()
    {
        if (!Config::get('laratrust.use_teams')) {
            return null;
        }

        return $this->morphToMany(
                Config::get('laratrust.models.team'),
                'user',
                Config::get('laratrust.tables.role_user'),
                Config::get('laratrust.foreign_keys.user'),
                Config::get('laratrust.foreign_keys.team')
            )
            ->withPivot(Config::get('laratrust.foreign_keys.role'));
    }
public function rolesTeams()
    {
        if (!Config::get('laratrust.use_teams')) {
            return null;
        }

        return $this->morphToMany(
                Config::get('laratrust.models.team'),
                'user',
                Config::get('laratrust.tables.role_user'),
                Config::get('laratrust.foreign_keys.user'),
                Config::get('laratrust.foreign_keys.team')
            )
            ->withPivot(Config::get('laratrust.foreign_keys.role'));
    }
public function rolesTeams ( ) { if ( ! Config :: get ( 'laratrust.use_teams' ) ) { return null ; } return $ this -> morphToMany ( Config :: get ( 'laratrust.models.team' ) , 'user' , Config :: get ( 'laratrust.tables.role_user' ) , Config :: get ( 'laratrust.foreign_keys.user' ) , Config :: get ( 'laratrust.foreign_keys.team' ) ) -> withPivot ( Config :: get ( 'laratrust.foreign_keys.role' ) ) ; }
Many-to-Many relations with Team associated through the roles.

@return \Illuminate\Database\Eloquent\Relations\MorphToMany
Many - to - Many relations with Team associated through the roles .