Nexmo / nexmo-laravel

Add Vonage functionality such as SMS and voice calling to your Laravel app with this Laravel Service Provider.
MIT License
317 stars 79 forks source link

Ambigious Class Resolution #58

Closed GraphicDesignElite closed 3 years ago

GraphicDesignElite commented 3 years ago

Ive been using this package in our project for about a year or so. Originally as nexmo/laravel. It seems running composer update has pulled the new version into my code, vonage/client.

Now when deploying to laravel forge, I have an issue with Ambiguous class resolutions. I get messages like the following, and a report that deployment failed.

Warning: Ambiguous class resolution, "Vonage\Network" was found 2x: in "/home/forge/cpadirectory.graphicdesignelite.net/vendor/nexmo/client-core/src/Network.php" and "/home/forge/cpadirectory.graphicdesignelite.net/vendor/vonage/client-core/src/Network.php", the first will be used. Warning: Ambiguous class resolution, "Vonage\Response" was found 2x: in "/home/forge/cpadirectory.graphicdesignelite.net/vendor/nexmo/client-core/src/Response.php" and "/home/forge/cpadirectory.graphicdesignelite.net/vendor/vonage/client-core/src/Response.php", the first will be used.

dragonmantank commented 3 years ago

This looks like it's including both our nexmo and vonage packages. Check your composer.json, and if you are manually requiring nexmo/client or nexmo/client-core, you can remove those. nexmo/laravel is set to pull in vonage/client automatically, which is the replacement for the nexmo/client packages.

The vonage/client and vonage/client-core packages support handling both the \Nexmo and \Vonage namespace, so dropping the older package should not require any code changes (though during refactors I would swap over to the \Vonage namespace for classes when you get the chance).

GraphicDesignElite commented 3 years ago

That does look to have solved that issue, thanks so much, Chris.