Convert currencies

This commit is contained in:
Hillel Coren 2017-12-21 11:59:03 +02:00
parent 3773999ed0
commit f37559a239

View File

@ -5,6 +5,7 @@ namespace App\Console\Commands;
use App\Libraries\CurlUtils; use App\Libraries\CurlUtils;
use Carbon; use Carbon;
use Str; use Str;
use Cache;
use App\Models\Invoice; use App\Models\Invoice;
use App\Models\Currency; use App\Models\Currency;
use App\Ninja\Mailers\ContactMailer as Mailer; use App\Ninja\Mailers\ContactMailer as Mailer;
@ -178,6 +179,8 @@ class SendReminders extends Command
foreach ($data->rates as $code => $rate) { foreach ($data->rates as $code => $rate) {
Currency::whereCode($code)->update(['exchange_rate' => $rate]); Currency::whereCode($code)->update(['exchange_rate' => $rate]);
} }
Cache::forget('currencies');
} }
/** /**