laravel-currency: Table doesn't exist on installing
After this:
php artisan vendor:publish --provider="Torann\Currency\CurrencyServiceProvider"
I receive this:
[Illuminate\Database\QueryException]
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'sistemaimobiliario.currencies' doesn't exist (SQL: select * from `currencies`)
[PDOException]
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'sistemaimobiliario.currencies' doesn't exist
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 1
- Comments: 17 (6 by maintainers)
Commits related to this issue
- Update currency.php Fix for Issue #33 — committed to 0s1r1s/laravel-currency by 0s1r1s 8 years ago
- Update currency.php Fix for #33 — committed to 0s1r1s/laravel-currency by 0s1r1s 8 years ago
I’m looking into this now. From what I remember I ran into this problem with another project I had and fixed it.
I just released a new version. http://lyften.com/projects/laravel-currency/doc/upgrade.html
It uses a middleware to handle currency switching so the database isn’t trying to be called when the app boots.
Indeed!
As a temporary fix I am overriding the
getCacheCurrenciesand have the below condition:You’re right. The Problem is the
getCacheCurrencies()function which is calling the all method of the driver.A simple
if ($this->database->hasTable($table))would solve the issue. But I don’t know the code of this bundle so @Torann should decide ^^.