Torann / laravel-currency

This provides Laravel with currency functions such as currency formatting and conversion using up-to-date exchange rates.
http://lyften.com/projects/laravel-currency
BSD 2-Clause "Simplified" License
392 stars 137 forks source link

Currency::hasCurrency() return always true #16

Closed nlemsieh closed 8 years ago

nlemsieh commented 10 years ago

I tried to use

Currency::hasCurrency('EUR')

But it seams to return always true. Then I adopted this solution :


public function hasCurrency($currency)
    {
    return $currency == $this->getCurrencyCode();
    // return isset($this->currencies[$currency]);
    }
Torann commented 8 years ago

Your approach will only check if the current currency matches the one you passed to the function. The hasCurrency is meant to check if the currency you pass to it is in the system.