Comments (2)
Hey @olimortimer,
Huge thanks for flagging this for me. It looks like I've forgotten to update the docs and upgrade guide to mention this part 🤦♂️
Context
Just for a bit of context (for yourself or anyone who might run into this issue too):
As of v6.0.0, the AshAllenDesign\LaravelExchangeRates\Classes\ExchangeRate
class isn't directly responsible for handling the exchange rates anymore. Instead, it's a manager class that forwards the method call to the correct driver class that you want to use.
So from v6.0.0 onwards, this class should be resolved from the container rather than just using new ExchangeRate()
. Instead, you should use something like this instead:
use AshAllenDesign\LaravelExchangeRates\Classes\ExchangeRate;
$exchangeRate = app(ExchangeRate::class)->exchangeRate(...);
Alternatively, you could also use the facade like so:
use AshAllenDesign\LaravelExchangeRates\Facades\ExchangeRate;
$exchangeRate = ExchangeRate::exchangeRate(...);
Sorry for any problems it might have caused for you! I'll get the docs updated today 😄
Does using one of the above approaches get your code running again?
from laravel-exchange-rates.
Perfect, thank you. The following did the trick;
use AshAllenDesign\LaravelExchangeRates\Facades\ExchangeRate;
$exchangeRate = ExchangeRate::exchangeRate('GBP', 'EUR');
from laravel-exchange-rates.
Related Issues (20)
- Automatic cache clearing / choosing the cache store HOT 1
- ExchangeRateHost Driver now needs an API key HOT 2
- API Error HOT 7
- Is it possible to creare a failover with this package ? HOT 2
- Format converted values
- Installation Failed (Guzzle version Issue) HOT 2
- Invalid conversion for Float values HOT 1
- convert() method does not calculate accurately HOT 1
- How to add Local Currency HOT 1
- Can't convert decimal numbers HOT 1
- Undefined index: rates exception caused by missing_access_key API error HOT 9
- base_currency_access_restricted HOT 1
- free Subscription Plan does not work HOT 1
- New Exchange Rates API
- You have not specified a Time-Frame HOT 4
- Update $allowableCurrencies HOT 2
- How do you generate Facade php docs? HOT 2
- Use frankfurter.app HOT 1
- now() helper function not always available. Use Carbon::now() instead. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-exchange-rates.