PHPackages                             brunoinds/sunat-dolar-laravel - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. brunoinds/sunat-dolar-laravel

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

brunoinds/sunat-dolar-laravel
=============================

v1.1.0(2y ago)0417MITPHP

Since Dec 31Pushed 2y ago1 watchersCompare

[ Source](https://github.com/brunoinds/sunat-dolar-laravel)[ Packagist](https://packagist.org/packages/brunoinds/sunat-dolar-laravel)[ RSS](/packages/brunoinds-sunat-dolar-laravel/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (5)DependenciesVersions (6)Used By (0)

PHP SUNAT Peru Currency Exchange
================================

[](#php-sunat-peru-currency-exchange)

A simple PHP library for exchanging currencies based on Peruvian SUNAT exchange rates.

[![Total Downloads](https://camo.githubusercontent.com/9aa55517ecf2f702494f95c2704d4bd2a9dfe0ce3c942560a115e786de98db76/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6272756e6f696e64732f73756e61742d646f6c61722d6c61726176656c)](https://packagist.org/packages/brunoinds/sunat-dolar-laravel)[![Latest Stable Version](https://camo.githubusercontent.com/3bed80bcfa0016f4c5b753e3ba938a7a11290f5ce11e676ff393e5370dc274b7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6272756e6f696e64732f73756e61742d646f6c61722d6c61726176656c)](https://packagist.org/packages/brunoinds/sunat-dolar-laravel)[![License](https://camo.githubusercontent.com/f04e9ef87b4ba143fae5575224af23a093e7247a6d3ef5371c0478073c54be83/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6272756e6f696e64732f73756e61742d646f6c61722d6c61726176656c)](https://packagist.org/packages/brunoinds/sunat-dolar-laravel)

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

[](#installation)

Install via Composer:

```
composer require brunoinds/sunat-dolar-laravel
```

Usage
-----

[](#usage)

The `Exchange` class provides methods for exchanging between PEN and USD:

```
use Brunoinds\SunatDolarLaravel\Exchange;
use Brunoinds\SunatDolarLaravel\Enums\Currency;

// Get current exchange rate
$result = Exchange::now()->convert(Currency::USD, 1)->to(Currency::PEN);

// Get historical exchange rate
$date = new DateTime('2023-12-10');
$result = Exchange::on($date)
                ->convert(Currency::USD, 1)
                ->to(Currency::PEN);
echo $result // 0.27

// Get buy/sell prices
$dollarBuy = Exchange::on($date)->getDollarBuyPrice(); //3.749;
$solesSell = Exchange::on($date)->getSolesSellPrice(); //0.266
```

The `Currency` enum provides constants for the supported currencies:

```
use Brunoinds\SunatDolarLaravel\Enums\Currency;

Currency::USD; // 'USD'
Currency::PEN; // 'PEN'
```

Testing
-------

[](#testing)

Unit tests are located in the `tests` directory. Run tests with:

```
composer test

```

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

[](#contributing)

Pull requests welcome!

License
-------

[](#license)

MIT License

Powered by:
-----------

[](#powered-by)

- [API Tipo de cambio SUNAT](https://apis.net.pe/api-tipo-cambio.html)

Let me know if you would like any sections expanded or have any other feedback!

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 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 ~23 days

Total

5

Last Release

822d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/54acc3d3fd4f73272aaec761ab85bf40397736e250431ec7c1cb34de791e9f18?d=identicon)[brunoinds](/maintainers/brunoinds)

---

Top Contributors

[![brunoinds](https://avatars.githubusercontent.com/u/49789611?v=4)](https://github.com/brunoinds "brunoinds (7 commits)")

### Embed Badge

![Health badge](/badges/brunoinds-sunat-dolar-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/brunoinds-sunat-dolar-laravel/health.svg)](https://phpackages.com/packages/brunoinds-sunat-dolar-laravel)
```

PHPackages © 2026

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