From db35da3c61f1ab7fcb8851f51814135130417579 Mon Sep 17 00:00:00 2001 From: Patrick Date: Wed, 9 Feb 2022 00:28:23 +0100 Subject: [PATCH] Update CartItemModel.php --- src/Models/CartItemModel.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Models/CartItemModel.php b/src/Models/CartItemModel.php index 209bce8..c429e1b 100644 --- a/src/Models/CartItemModel.php +++ b/src/Models/CartItemModel.php @@ -38,6 +38,14 @@ class CartItemModel extends Model protected $casts = [ '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.