¨4.0.1¨
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Modules\Currency\Entities;
|
||||
|
||||
use Money\Currency;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Modules\Support\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Modules\Currency\Admin\CurrencyRateTable;
|
||||
@@ -17,6 +17,7 @@ class CurrencyRate extends Model
|
||||
*/
|
||||
protected $fillable = ['currency', 'rate'];
|
||||
|
||||
|
||||
/**
|
||||
* Perform any actions required after the model boots.
|
||||
*
|
||||
@@ -29,10 +30,12 @@ class CurrencyRate extends Model
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Refresh all supported currencies exchange rate.
|
||||
*
|
||||
* @param \Modules\Currency\Services\CurrencyRateExchanger $exchanger
|
||||
* @param CurrencyRateExchanger $exchanger
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function refreshRates(CurrencyRateExchanger $exchanger)
|
||||
@@ -46,10 +49,12 @@ class CurrencyRate extends Model
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get currency rate for the given currency.
|
||||
*
|
||||
* @param string $currency
|
||||
*
|
||||
* @return int|float
|
||||
*/
|
||||
public static function for($currency)
|
||||
@@ -59,10 +64,11 @@ class CurrencyRate extends Model
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get table data for the resource
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function table()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user