Files
exchange-2.0/app/Models/Currency.php
T
CheeSiong 1dfb75545f List Currency Rate Logic Class
Fetch Currency Rate Logic Class
 Create Currency Rate Logic Class
 Update Currency Rate Logic Class
Currency Rate Converter Rate
2020-12-30 08:47:12 +08:00

45 lines
899 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Relations\hasMany;
/**
* Class Currency
* @package App\Models
* @version August 4, 2020, 4:36 am
*
* @property \App\Models\Country country_id
* @property string name
* @property string short_code
* @property string symbol
*/
class Currency extends AbstractModel
{
use SoftDeletes;
protected $table = 'currencies';
protected $dates = ['deleted_at'];
/**
* @return \Illuminate\Database\Eloquent\Relations\HasOne
**/
public function country(): HasOne
{
return $this->hasOne(Country::class, 'country_id', 'id');
}
/**
* @return hasMany
*/
public function currency_rates(): hasMany
{
return $this->hasMany(CurrencyRate::class, 'currency_id');
}
}