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
393 stars 136 forks source link

Where does "setUserCurrency($code)" store value #82

Closed ablishek closed 6 years ago

ablishek commented 7 years ago

Hi,

So far I have no hiccups, but I need to be able to set default currencies for users. I noticed that your documentation has reference to this end, with the setUserCurrency($code) method.

Question, where does Lyften actually store this data? DB, JSON? Because when I ran the Migration, it created a single Currencies table, and in Users table left untouched.

I wanted to make sure this was proper before continuing, if you can advise. In any rate, is there a way to over ride default with a database based solution?

Thanks!

Torann commented 7 years ago

I just stores it in the currency instance. If you want to store it in the DB or session you will need to extend the middleware Torann\Currency\Middleware\CurrencyMiddleware and add what you need done in the setUserCurrency method. This is what I do with my sites

ablishek commented 6 years ago

Great thanks