PHPackages                             dostrog/larate - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. dostrog/larate

ActiveLibrary[API Development](/categories/api)

dostrog/larate
==============

Small library to access to currency exchange rates API of CBRF (Bank of Russia) and NBU (National Bank of Ukraine) from Laravel

v2.0.0(11mo ago)1129↓50%MITPHPPHP ^8.4CI passing

Since Feb 18Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/dostrog/larate)[ Packagist](https://packagist.org/packages/dostrog/larate)[ Docs](https://github.com/dostrog/larate)[ GitHub Sponsors](https://github.com/dostrog)[ RSS](/packages/dostrog-larate/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (8)Versions (7)Used By (0)

Larate
======

[](#larate)

[![Latest Version on Packagist](https://camo.githubusercontent.com/ea32139022bba52145916543e5ef3a7fce20ba83fd23360101eb0ddfae01d5b0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646f7374726f672f6c6172617465)](https://packagist.org/packages/dostrog/larate)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/c44280e08c7a8018e032adbf60f1930168a799fd2283371ebc390d2834449d9c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f646f7374726f672f6c61726174652f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://img.shields.io/github/actions/workflow/status/dostrog/larate/test.yml?branch=master)[![Total Downloads](https://camo.githubusercontent.com/712c1ae8acb26b8e2247f4f7851da1783808f511c19c375dad149d427b2aa594/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f646f7374726f672f6c6172617465)](https://packagist.org/packages/dostrog/larate)

Overview
--------

[](#overview)

A simple Laravel package used for interacting with the [Bank of Russia](https://www.cbr.ru/development/SXML/) and [National Bank of Ukraine](https://bank.gov.ua/ua/open-data/api-dev) API. 'Larate' allow you to get the latest or historical converted monetary values between RUB (UAH) and other currencies.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require dostrog/larate
```

You can publish the config file with:

```
php artisan vendor:publish --provider="Dostrog\Larate\Providers\LarateServiceProvider" --tag="config"
```

This is the contents of the published config file:

```
return [
    'default_base_currency' => 'RUB',
    'service' => [
        'RUB' => Dostrog\Larate\Services\RussianCentralBank::class,
        'UAH' => Dostrog\Larate\Services\NationalBankOfUkraine::class,
    ],
];
```

Usage
-----

[](#usage)

```
// instantiate from Laravel IoC for inject provider
// according to config it maybe RUB (converted) rates from Central Bank OF Russia
$provider = app()->make(Larate::class);
$pair = new CurrencyPair('RUB', 'USD');
$date = Carbon::parse('2020-01-16');
$rate = $provider->getExchangeRate($pair, $date);
$value = $rate->getValue(); // 61.4328

// ...or using factory method, i.e. for getting UAH (converted) rates from National Bank of Ukraine
$provider = Larate::createForBaseCurrency('UAH');
$pair = new CurrencyPair('UAH', 'USD');
$date = Carbon::parse('2020-01-16');
$rate = $provider->getExchangeRate($pair, $date);
$value = $rate->getValue(); // 23.9821

// ...or using Laravel's Facades
$rate = LarateFacade::getExchangeRate($pair, $date);
$value = $rate->getValue();
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Sergey Donin](https://github.com/dostrog)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance52

Moderate activity, may be stable

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~394 days

Total

5

Last Release

338d ago

Major Versions

v1.0.5 → v2.0.02025-06-14

PHP version history (2 changes)v1.0.2PHP ^7.4|^8.0

v2.0.0PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/64cb5c8fefac5b1a2b6e793d42af9b67c721ba11acfbf0afc0f555b080e0c68f?d=identicon)[dostrog](/maintainers/dostrog)

---

Top Contributors

[![dostrog](https://avatars.githubusercontent.com/u/948264?v=4)](https://github.com/dostrog "dostrog (120 commits)")

---

Tags

apilaravelcurrencyratesRUBdostroglarateuah

###  Code Quality

TestsPHPUnit

Static AnalysisRector

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/dostrog-larate/health.svg)

```
[![Health](https://phpackages.com/badges/dostrog-larate/health.svg)](https://phpackages.com/packages/dostrog-larate)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[nickurt/laravel-postcodeapi

Universal PostcodeApi for Laravel 11.x/12.x/13.x

97221.2k](/packages/nickurt-laravel-postcodeapi)[smodav/mpesa

M-Pesa API implementation

16363.7k1](/packages/smodav-mpesa)[mozex/anthropic-laravel

Anthropic PHP for Laravel is a supercharged PHP API client that allows you to interact with the Anthropic API

71226.4k1](/packages/mozex-anthropic-laravel)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

762.6k](/packages/scriptdevelop-whatsapp-manager)[ardakilic/mutlucell

Mutlucell SMS API wrapper for sending sms text messages for Laravel

457.3k](/packages/ardakilic-mutlucell)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
