add new metrics, graph metrics, prepare basket to storage

This commit is contained in:
ludo
2024-01-29 23:44:49 +01:00
parent 9fcc81f4d9
commit 53ad10eefa
12 changed files with 219 additions and 214 deletions

View File

@@ -7,6 +7,10 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Basket extends Model
{
protected $fillable = [
'id', 'cart_data',
];
protected $guarded = ['id'];
protected $table = 'shop_baskets';
@@ -15,4 +19,14 @@ class Basket extends Model
{
return $this->belongsTo(Offer::class);
}
}
public function setCartDataAttribute($value)
{
$this->attributes['cart_data'] = serialize($value);
}
public function getCartDataAttribute($value)
{
return unserialize($value);
}
}