mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-11 18:54:33 +00:00
Update CartItem.php
This commit is contained in:
@@ -10,6 +10,8 @@ use Illuminate\Contracts\Support\Arrayable;
|
||||
use Illuminate\Contracts\Support\Jsonable;
|
||||
use Illuminate\Support\Arr;
|
||||
use Money\Money;
|
||||
use Money\Formatter\DecimalMoneyFormatter;
|
||||
use Money\Currencies\ISOCurrencies;
|
||||
use ReflectionClass;
|
||||
|
||||
/**
|
||||
@@ -283,6 +285,14 @@ class CartItem implements Arrayable, Jsonable
|
||||
return json_encode($this->toArray(), $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a unique id for the cart item.
|
||||
*/
|
||||
private function formatMoney(Money $money) : string
|
||||
{
|
||||
return (new DecimalMoneyFormatter(new ISOCurrencies()))->format($money);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a unique id for the cart item.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user