Giter Club home page Giter Club logo

Comments (2)

ash-jc-allen avatar ash-jc-allen commented on July 29, 2024

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.

olimortimer avatar olimortimer commented on July 29, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.