Files
YNWA Fawzy 8a3bbd7cb0 - fix plugin not working
- minimize data sent by plugin
- fix the lowest price always zero.
- add method to update the price when you visit the product page with the extension.
- fix new store not added on existing product
- format prices on chart
- fix multiple prices not showing in tooltip in price history widget when store is added later on.
2024-08-04 18:42:52 +04:00

35 lines
592 B
PHP

<?php
namespace App\Models;
use App\Casts\Money;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class PriceHistory extends Model
{
use HasFactory;
protected $fillable=[
"date",
"price",
"product_id",
"store_id",
"used_price",
];
protected function casts(): array
{
return [
"price"=>Money::class,
"used_price"=>Money::class
];
}
public function product_store()
{
return $this->belongsTo(ProductStore::class);
}
}