Update CartItemModel.php

This commit is contained in:
Patrick
2022-02-09 00:28:23 +01:00
committed by GitHub
parent 312a010406
commit db35da3c61

View File

@@ -38,6 +38,14 @@ class CartItemModel extends Model
protected $casts = [ protected $casts = [
'options' => 'array', // Stored as JSON string, cast to array 'options' => 'array', // Stored as JSON string, cast to array
]; ];
/**
* Get the parent commentable model (post or video).
*/
public function model()
{
return $this->morphTo();
}
/** /**
* Get the CartItems for the cart. * Get the CartItems for the cart.