add new metrics, graph metrics, prepare basket to storage
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user