binance-connector-php icon indicating copy to clipboard operation
binance-connector-php copied to clipboard

Class "Binance\Spot\Client" not found after installing binance-connector-php v2.0.1

Open jerchomatthew opened this issue 1 year ago • 1 comments

Hello Binance team,

I installed the latest version of binance/binance-connector-php via Composer in my Laravel 10 project:

composer require binance/binance-connector-php

The package installs successfully, but when I try to use the Spot API in my service class like this:

use Binance\Spot\Client;

$client = new Client(env('BINANCE_API_KEY'), env('BINANCE_API_SECRET'));

I receive this error:

Class "Binance\Spot\Client" not found

I’ve confirmed the files exist at:

vendor/binance/binance-connector-php/src/spot/

but the autoloader does not recognize Binance\Spot\Client.

Could you please confirm the correct namespace and class name for initializing the Spot client in the latest release (v2.0.1)?

jerchomatthew avatar Oct 24 '25 17:10 jerchomatthew

Hello,

Could you please try with the spot example ?

cd examples/spot;
composer install;
php general/TimeExample.php;

If this works well, please double check if the autoload.php is properly loaded in your PHP script.

Thank you.

theo-s68 avatar Oct 30 '25 03:10 theo-s68