feat: implement currency rates tracking with models, migrations and views

This commit is contained in:
2025-05-24 05:59:12 +03:00
parent 72b4eff3ee
commit b19748ef20
21 changed files with 690 additions and 361 deletions
+33
View File
@@ -0,0 +1,33 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Rate extends Model
{
use HasFactory;
protected $fillable = [
'currency_id',
'city_id',
'buy_price',
'sell_price',
'date',
];
protected $casts = [
'date' => 'date:Y-m-d',
];
public function currency()
{
return $this->belongsTo(Currency::class);
}
public function city()
{
return $this->belongsTo(City::class);
}
}