mirror of
https://github.com/Cybrarist/Discount-Bandit.git
synced 2026-11-24 19:49:54 +01:00
24 lines
456 B
PHP
24 lines
456 B
PHP
<?php
|
|
|
|
namespace App\Helpers;
|
|
|
|
use App\Models\Currency;
|
|
use Illuminate\Support\Facades\Cache;
|
|
|
|
class CurrencyHelper
|
|
{
|
|
public static function get_currencies($currency_id = null)
|
|
{
|
|
|
|
$currencies = Cache::remember('currencies', 86400, function () {
|
|
return Currency::pluck("code", "id")->toArray();
|
|
});
|
|
|
|
if ($currency_id) {
|
|
return $currencies[$currency_id];
|
|
}
|
|
|
|
return $currencies;
|
|
}
|
|
}
|