You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 14, 2023. It is now read-only.
To convert from one currency to another you may chain the methods:
21
21
22
22
```php
23
-
use AmrShawky\Currency\Facade\Currency;
23
+
use AmrShawky\LaravelCurrency\Facade\Currency;
24
24
25
25
Currency::convert()
26
26
->from('USD')
@@ -32,7 +32,7 @@ This will return the converted amount or `null` on failure.
32
32
The amount to be converted is default to `1`, you may specify the amount:
33
33
34
34
```php
35
-
use AmrShawky\Currency\Facade\Currency;
35
+
use AmrShawky\LaravelCurrency\Facade\Currency;
36
36
37
37
Currency::convert()
38
38
->from('USD')
@@ -44,7 +44,7 @@ Currency::convert()
44
44
- Convert currency using historical exchange rates `YYYY-MM-DD`:
45
45
46
46
```php
47
-
use AmrShawky\Currency\Facade\Currency;
47
+
use AmrShawky\LaravelCurrency\Facade\Currency;
48
48
49
49
Currency::convert()
50
50
->from('USD')
@@ -56,7 +56,7 @@ Currency::convert()
56
56
- Round the converted amount to decimal places:
57
57
58
58
```php
59
-
use AmrShawky\Currency\Facade\Currency;
59
+
use AmrShawky\LaravelCurrency\Facade\Currency;
60
60
61
61
Currency::convert()
62
62
->from('USD')
@@ -68,7 +68,7 @@ Currency::convert()
68
68
- You may also switch data source between forex `default`, bank view or crypto currencies:
69
69
70
70
```php
71
-
use AmrShawky\Currency\Facade\Currency;
71
+
use AmrShawky\LaravelCurrency\Facade\Currency;
72
72
73
73
Currency::convert()
74
74
->from('BTC')
@@ -81,7 +81,7 @@ Currency::convert()
81
81
To get latest rates you may chain the methods:
82
82
83
83
```php
84
-
use AmrShawky\Currency\Facade\Currency;
84
+
use AmrShawky\LaravelCurrency\Facade\Currency;
85
85
86
86
Currency::rates()
87
87
->latest()
@@ -102,7 +102,7 @@ This will return an `array` of all available currencies or `null` on failure.
102
102
- Just like currency conversion you may chain any of the available methods:
103
103
104
104
```php
105
-
use AmrShawky\Currency\Facade\Currency;
105
+
use AmrShawky\LaravelCurrency\Facade\Currency;
106
106
107
107
Currency::rates()
108
108
->latest()
@@ -118,7 +118,7 @@ Currency::rates()
118
118
Historical rates are available for most currencies all the way back to the year of 1999.
119
119
120
120
```php
121
-
use AmrShawky\Currency\Facade\Currency;
121
+
use AmrShawky\LaravelCurrency\Facade\Currency;
122
122
123
123
Currency::rates()
124
124
->historical('2020-01-01') //`YYYY-MM-DD` Required date parameter to get the rates for
@@ -135,7 +135,7 @@ Currency::rates()
135
135
```
136
136
Same as latest rates you may chain any of the available methods:
137
137
```php
138
-
use AmrShawky\Currency\Facade\Currency;
138
+
use AmrShawky\LaravelCurrency\Facade\Currency;
139
139
140
140
Currency::rates()
141
141
->historical('2020-01-01')
@@ -151,7 +151,7 @@ Timeseries are for daily historical rates between two dates of your choice, with
151
151
This will return an `array` or `null` on failure.
152
152
153
153
```php
154
-
use AmrShawky\Currency\Facade\Currency;
154
+
use AmrShawky\LaravelCurrency\Facade\Currency;
155
155
156
156
Currency::rates()
157
157
->timeSeries('2021-05-01', '2021-05-02') //`YYYY-MM-DD` Required dates range parameters
@@ -179,7 +179,7 @@ Retrieve information about how currencies fluctuate on a day-to-day basis, with
179
179
This will return an `array` or `null` on failure.
180
180
181
181
```php
182
-
use AmrShawky\Currency\Facade\Currency;
182
+
use AmrShawky\LaravelCurrency\Facade\Currency;
183
183
184
184
Currency::rates()
185
185
->fluctuations('2021-03-29', '2021-04-15') //`YYYY-MM-DD` Required dates range parameters
@@ -208,7 +208,7 @@ The default behavior is to return `null` for errors that occur during the reques
208
208
If you would like to throw an exception instead, you may use the `throw` method, The `throw` method returns the currency instance, allowing you to chain other methods:
209
209
210
210
```php
211
-
use AmrShawky\Currency\Facade\Currency;
211
+
use AmrShawky\LaravelCurrency\Facade\Currency;
212
212
213
213
Currency::convert()
214
214
->from('USD')
@@ -221,7 +221,7 @@ Currency::convert()
221
221
If you would like to perform some additional logic before the exception is thrown, you may pass a closure to the throw method:
222
222
223
223
```php
224
-
use AmrShawky\Currency\Facade\Currency;
224
+
use AmrShawky\LaravelCurrency\Facade\Currency;
225
225
226
226
Currency::convert()
227
227
->from('USD')
@@ -237,7 +237,7 @@ Currency::convert()
237
237
- You may use the `withoutVerifying` method to indicate that TLS certificates should not be verified when sending the request:
238
238
239
239
```php
240
-
use AmrShawky\Currency\Facade\Currency;
240
+
use AmrShawky\LaravelCurrency\Facade\Currency;
241
241
242
242
Currency::convert()
243
243
->from('USD')
@@ -249,7 +249,7 @@ Currency::convert()
249
249
- You may specify additional [Guzzle request options](https://docs.guzzlephp.org/en/stable/request-options.html"Guzzle request options") using the `withOptions` method. The `withOptions` method accepts an array of key / value pairs:
250
250
251
251
```php
252
-
use AmrShawky\Currency\Facade\Currency;
252
+
use AmrShawky\LaravelCurrency\Facade\Currency;
253
253
254
254
Currency::rates()
255
255
->historical('2021-04-30')
@@ -262,7 +262,7 @@ Currency::rates()
262
262
263
263
- The `when` method will execute the given callback when the first argument given to the method evaluates to true:
264
264
```php
265
-
use AmrShawky\Currency\Facade\Currency;
265
+
use AmrShawky\LaravelCurrency\Facade\Currency;
266
266
267
267
Currency::rates()
268
268
->latest()
@@ -282,7 +282,7 @@ Currency::rates()
282
282
Currency uses Laravel facades which makes it easy to [mock](https://laravel.com/docs/8.x/mocking#mocking-facades"Mocking Laravel Facades") so it's not actually executed during the test:
0 commit comments