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

create currency command gives error. #64

Closed BrunoTeixeiraNavila closed 6 years ago

BrunoTeixeiraNavila commented 7 years ago

I tried the command on the documentation:

currency()->create([ 'currency_name' => 'U.S. Dollar', 'currency_code' => 'USD', 'currency_symbol' => '$', 'currency_format' => '$1,0.00', 'exchange_rate' => 1.00000000, 'active' => 1, ]);

I get the following error:

Undefined index: code

Torann commented 7 years ago

The doc was incorrect. It was for an old version. It's being updated now. Here is what it should be:

currency()->create([
    'name' => 'U.S. Dollar',
    'code' => 'USD',
    'symbol' => '$',
    'format' => '$1,0.00',
    'exchange_rate' => 1.00000000,
    'active' => 1,
]);