30 lines
535 B
PHP
30 lines
535 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* @property array<string, float> $rates
|
|
*/
|
|
class ExchangeRate extends Model
|
|
{
|
|
/** @use HasFactory<\Database\Factories\ExchangeRateFactory> */
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'base_currency',
|
|
'date',
|
|
'rates',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'date' => 'date',
|
|
'rates' => 'array',
|
|
];
|
|
}
|
|
}
|