first commit
This commit is contained in:
39
Models/CurrencyExchangeRate.php
Normal file
39
Models/CurrencyExchangeRate.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Koneko\VuexyStoreManager\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Koneko\VuexyAdmin\Models\User;
|
||||
|
||||
class CurrencyExchangeRate extends Model
|
||||
{
|
||||
protected $table = 'currency_exchange_rates';
|
||||
|
||||
protected $fillable = [
|
||||
'c_currency',
|
||||
'exchange_rate',
|
||||
'exchange_date',
|
||||
'source',
|
||||
'updated_by',
|
||||
'comments',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'exchange_rate' => 'decimal:6',
|
||||
'exchange_date' => 'date',
|
||||
'source' => 'string',
|
||||
'updated_by' => 'integer',
|
||||
];
|
||||
|
||||
// Relación con la moneda
|
||||
public function currency()
|
||||
{
|
||||
return $this->belongsTo(Currency::class, 'c_currency', 'c_currency');
|
||||
}
|
||||
|
||||
// Relación con el usuario que actualizó el tipo de cambio
|
||||
public function updatedByUser()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'updated_by');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user