Class "Binance\Spot\Client" not found after installing binance-connector-php v2.0.1
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)?
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.