Skip to content

Commit

Permalink
Update CartItem.php
Browse files Browse the repository at this point in the history
  • Loading branch information
hardevine authored Apr 15, 2020
1 parent fe4f4c0 commit 00e180b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/CartItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,11 @@ public function toArray()
*/
public function toJson($options = 0)
{
if(isset($this->associatedModel){
if (isset($this->associatedModel)){

return json_encode(array_merge($this->toArray(), ['model' => $this->model]), $options);
}

return json_encode($this->toArray(), $options);
}

Expand Down

2 comments on commit 00e180b

@abderrahmane-belabes
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm usign App\Panier instead of App\Product as my model , should i use App\Product ?

@hardevine
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm usign App\Panier instead of App\Product as my model , should i use App\Product ?

no need

Please sign in to comment.