Files
exchange-2.0/app/Models/Currency.php
T
omair saleh 05401f6bbc large commit
2021-03-11 13:06:40 +08:00

45 lines
875 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Relations\hasMany;
/**
* Class Currency
* @package App\Models
*
* @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 BelongsTo
*/
public function country(): BelongsTo
{
return $this->BelongsTo(Country::class, 'country_id', 'id');
}
/**
* @return hasMany
*/
public function rates(): hasMany
{
return $this->hasMany(CurrencyRate::class, 'currency_id');
}
}