Skip to content

Commit 30b2f74

Browse files
authored
Merge pull request #24 from worksome/feature/frankfurter
feat: prepare for 2.x release
2 parents 216d406 + d07f686 commit 30b2f74

File tree

8 files changed

+16
-47
lines changed

8 files changed

+16
-47
lines changed

.github/workflows/phpstan.yml renamed to .github/workflows/static.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: PHPStan
1+
name: Static Analysis
22

33
on:
44
push:
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
phpstan:
11-
name: phpstan
11+
name: PHPStan
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v4

.github/workflows/run-tests.yml renamed to .github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: run-tests
1+
name: Tests
22

33
on:
44
push:

CHANGELOG.md

Lines changed: 0 additions & 32 deletions
This file was deleted.

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
Check exchange rates for any currency in Laravel
44

5-
[![Tests](https://github.com/worksome/exchange/actions/workflows/run-tests.yml/badge.svg)](https://github.com/worksome/exchange/actions/workflows/run-tests.yml)
6-
[![PHPStan](https://github.com/worksome/exchange/actions/workflows/phpstan.yml/badge.svg)](https://github.com/worksome/exchange/actions/workflows/phpstan.yml)
5+
[![Latest Version on Packagist](https://img.shields.io/packagist/v/worksome/exchange.svg?style=flat-square)](https://packagist.org/packages/worksome/exchange)
6+
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/worksome/exchange/tests.yml?branch=main&style=flat-square&label=Tests)](https://github.com/worksome/exchange/actions?query=workflow%3ATests+branch%3Amain)
7+
[![GitHub Static Analysis Action Status](https://img.shields.io/github/actions/workflow/status/worksome/exchange/static.yml?branch=main&style=flat-square&label=Static%20Analysis)](https://github.com/worksome/exchange/actions?query=workflow%3A"Static%20Analysis"+branch%3Amain)
8+
[![Total Downloads](https://img.shields.io/packagist/dt/worksome/exchange.svg?style=flat-square)](https://packagist.org/packages/worksome/exchange)
79

810
If your app supports multi-currency, you'll no doubt need to check exchange rates. There are many third party services
911
to accomplish this, but why bother reinventing the wheel when we've done all the hard work for you?
@@ -91,7 +93,7 @@ In your `exchange.php` config file, set `default` to `cache`, or set `EXCHANGE_D
9193
You'll also want to pick a strategy under `services.cache.strategy`. By default, this will be `fixer`, but you are free to change that.
9294
The strategy is the service that will be used to perform the exchange rate lookup when nothing is found in the cache.
9395

94-
There is also the option to override the `ttl` (how many seconds rates are cached for) and `key` for your cached rates.
96+
There is also the option to override the `ttl` (how many seconds rates are cached for), `key` for your cached rates, and the `store`.
9597

9698
## Artisan
9799

@@ -130,7 +132,7 @@ composer test
130132

131133
## Changelog
132134

133-
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
135+
Please see [GitHub Releases](https://github.com/worksome/exchange/releases) for more information on what has changed recently.
134136

135137
## Credits
136138

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"orchestra/testbench": "^8.0 || ^9.0",
2929
"pestphp/pest": "^2.33",
3030
"pestphp/pest-plugin-laravel": "^2.2",
31-
"worksome/coding-style": "^2.8"
31+
"worksome/coding-style": "^2.10"
3232
},
3333
"autoload": {
3434
"psr-4": {

config/exchange.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Supported: 'null', 'fixer', 'exchange_rate', 'frankfurter', 'cache'
1212
*/
1313

14-
'default' => env('EXCHANGE_DRIVER', 'exchange_rate'),
14+
'default' => env('EXCHANGE_DRIVER', 'frankfurter'),
1515

1616
'services' => [
1717

@@ -58,10 +58,10 @@
5858
*/
5959

6060
'cache' => [
61-
'strategy' => 'exchange_rate',
62-
'ttl' => 60 * 60 * 24, // 24 hours
63-
'key' => 'cached_exchange_rates',
64-
'store' => null,
61+
'strategy' => env('EXCHANGE_RATES_CACHE_STRATEGY', 'frankfurter'),
62+
'ttl' => env('EXCHANGE_RATES_CACHE_TTL', 60 * 60 * 24), // 24 hours
63+
'key' => env('EXCHANGE_RATES_CACHE_KEY', 'cached_exchange_rates'),
64+
'store' => env('EXCHANGE_RATES_CACHE_STORE'),
6565
],
6666
],
6767

src/Facades/Exchange.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ final class Exchange extends Facade
2020
*/
2121
public static function fake(array $rates = []): void
2222
{
23-
2423
/**
2524
* @var \Worksome\Exchange\Exchange $fake
25+
*
2626
* @phpstan-ignore-next-line
2727
*/
2828
$fake = self::$app->instance(\Worksome\Exchange\Exchange::class, self::getFacadeRoot());

src/Support/ExchangeRateManager.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace Worksome\Exchange\Support;
66

7-
use Illuminate\Cache\Repository;
87
use Illuminate\Contracts\Cache\Factory as CacheFactory;
98
use Illuminate\Http\Client\Factory;
109
use Illuminate\Support\Manager;

0 commit comments

Comments
 (0)