Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

JustinM's avatar

Guzzle/Nexmo Issues After Upgrading to Laravel 8 from 7

Hey all, on my local machine everything is working just fine. But once I deploy to staging/production I lose the ability to send SMS notifications and am met with the error:

Target class [Http\Adapter\Guzzle6\Client] does not exist.

This error occurs when trying to send SMS notifications via nexmo, as is evident in the trace, but all of my nexmo related packages are up to date as well, so I am not sure why they would be trying to use Guzzle6 in staging but Guzzle7 locally.

the only real difference between my local environment and staging/dev is that they are deployed using envoyer.

Here is my composer.json file:

    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=7.4.1",
        "arrilot/laravel-widgets": "^3.13",
        "barryvdh/laravel-snappy": "^0.4.6",
        "doctrine/dbal": "^2.10",
        "facade/ignition": "^2.3.6",
        "guzzlehttp/guzzle": "^6.5|^7.0.1",
        "intervention/image": "^2.4",
        "laravel/framework": "^8.0",
        "laravel/helpers": "^1.3",
        "laravel/horizon": "^5.7",
        "laravel/nexmo-notification-channel": "^2.5.1",
        "laravel/passport": "^10.0",
        "laravel/slack-notification-channel": "^2.0",
        "laravel/telescope": "^4.0",
        "laravel/tinker": "^2.0",
        "laravel/ui": "^3.0",
        "league/csv": "^8.2",
        "league/flysystem-aws-s3-v3": "~1.0",
        "maatwebsite/excel": "^3.1",
        "milon/barcode": "^8.0.1",
        "nexmo/client": "^2.4",
        "nexmo/laravel": "^2.4.1",
        "nunomaduro/collision": "^5.0",
        "predis/predis": "^1.1",
        "pusher/pusher-php-server": "^4.1.1",
        "webpatser/laravel-uuid": "^3.0"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "^9.0",
        "filp/whoops": "~2.0"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\": "app/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\": "tests/"
        }
    },
    "scripts": {
        "post-root-package-install": [
            "php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ],
        "post-install-cmd": [
            "Illuminate\Foundation\ComposerScripts::postInstall"
        ],
        "post-update-cmd": [
            "Illuminate\Foundation\ComposerScripts::postUpdate"
        ],
        "post-autoload-dump": [
            "Illuminate\Foundation\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover"
        ]
    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true
    }
}

Which as far as I can tell isn't the issue. I am starting to think it might be something with envoyer, though on my staging server I deleted the composer.lock file and the vendor directory from /current and did a fresh composer install. After doing this I was met with the same results.

0 likes
4 replies
JustinM's avatar

Inspecting my composer install output from my envoyer deployment does show a ton of warnings that don't come up locally. not sure how to resolve this, but I am assuming its related since they all happen to deal with vonage/nexmo and that's where my problem lies.

68 package suggestions were added by new dependencies, use `composer suggest` to see details.
Package fzaninotto/faker is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
Warning: Ambiguous class resolution, "Vonage\Secrets\Client" was found 2x: in "/home/forge/dev.environment/releases/20210609180253/vendor/vonage/client-core/src/Secrets/Client.php" and "/home/forge/dev.environment/releases/20210609180253/vendor/nexmo/client-core/src/Secrets/Client.php", the first will be used.
Warning: Ambiguous class resolution, "Vonage\Secrets\ClientFactory" was found 2x: in "/home/forge/dev.environment/releases/20210609180253/vendor/vonage/client-core/src/Secrets/ClientFactory.php" and "/home/forge/dev.environment/releases/20210609180253/vendor/nexmo/client-core/src/Secrets/ClientFactory.php", the first will be used.
Warning: Ambiguous class resolution, "Vonage\Secrets\Secret" was found 2x: in "/home/forge/dev.environment/releases/20210609180253/vendor/vonage/client-core/src/Secrets/Secret.php" and "/home/forge/dev.environment/releases/20210609180253/vendor/nexmo/client-core/src/Secrets/Secret.php", the first will be used.
Warning: Ambiguous class resolution, "Vonage\SMS\SentSMS" was found 2x: in "/home/forge/dev.environment/releases/20210609180253/vendor/vonage/client-core/src/SMS/SentSMS.php" and "/home/forge/dev.environment/releases/20210609180253/vendor/nexmo/client-core/src/SMS/SentSMS.php", the first will be used.
... truncated huge obnoxious list of warnings...

As you can see there seems to be a duplicate library in vendor named vonage (which nexmo is now vonage) but I am not specifying them in my composer.json. Also locally but the nexmo and vonage directories exist in my vendor directory and I am not met with these issues or warnings.

JustinM's avatar

Update: I fixed the warnings by removing the nexmo/client package and leaving nexmo/laravel however that did not resolve my issue. I've tried restarting the laravel horizon daemon, as well as running php artisan queue:restart which neither worked. I am tempted to reboot the entire server but don't want to cause an outage for the people currently using the site. Short of spinning up another server and doing a fresh install to test on, I am running out of ideas.

Ttebify's avatar

I was able to fix this by running:

composer require vonage/client --with-all-dependencies

This will update all of your dependencies. Once this is done, you should be able to use the vonage/client package without any problems.

Please or to participate in this conversation.