protected static function bootUsedByTeams()
    {
        static::addGlobalScope('team', function (Builder $builder) {
            static::teamGuard();

            $builder->where($builder->getQuery()->from . '.team_id', auth()->user()->currentTeam->getKey());
        });

        static::saving(function (Model $model) {
            static::teamGuard();

            if (!isset($model->team_id)) {
                $model->team_id = auth()->user()->currentTeam->getKey();
            }
        });
    }