nixsolutions/yandex-php-library
PHP library for working with Yandex APIs. Includes clients for Yandex.Direct, Yandex.Metrika, Yandex.Money, and OAuth, with service-specific request/response models and a shared HTTP layer. Helps add advertising, analytics, payment, and authorization features to PHP applications.
composer require nixsolutions/yandex-php-library. There is no Laravel service provider or auto-discovery — treat it as a plain PHP SDK you wire up yourself.src/Yandex/ (or vendor/nixsolutions/yandex-php-library/src/Yandex/). Services are namespaced per API, e.g. Yandex\Disk\DiskClient, Yandex\Metrika\MetrikaClient, Yandex\Translate\TranslateClient. Open the client class for the service you need and read its constructor plus public methods — that is your real API reference.oauth.yandex.ru to get a client ID/secret. Most services require an OAuth token and specific scopes (Disk, Metrika, Direct, etc.). Do not request broader scopes than you need.config/services.php and .env:
'yandex' => [
'client_id' => env('YANDEX_CLIENT_ID'),
'client_secret' => env('YANDEX_CLIENT_SECRET'),
'redirect' => env('YANDEX_REDIRECT_URI'),
'token' => env('YANDEX_TOKEN'),
],
getList/getResource) to confirm connectivity before building upload/download features.$this->app->singleton(DiskClient::class, fn () => new DiskClient(config('services.yandex.token')));
This also gives you one place to swap or mock it later.Cache::remember with short TTLs, since quotas are a real constraint.DiskService, MetrikaService, etc., in your app and implement them with the SDK. This makes unit tests trivial and isolates the rest of the app from the library's exception types and method signatures.oauth.yandex.ru — including trailing slashes and scheme.finally block.Http client can call several Yandex REST APIs directly, removing a stale dependency and giving you better logging, retries, and testability. Use the SDK where its request signing or payload shaping genuinely saves you work.How can I help you explore Laravel packages today?