i am adding cart with item using Cart::add function of darryldecode/laravelshoppingcart library and item added successfully in the cart by an (axios post request call) but when i am posting second (axios post request call) to get the information of cart in next request cart is empty
getting added items code (First axios call)
Cart::add([
'id' => $item->id,
'name' => $item->name,
'price' => !$license->coefficient ? $item->price : round($license->coefficient * $item->price, 2),
'quantity' => 1,
'attributes' => [
'license_id' => $request->get('licenseId')
]
]);
getting added items code (second axios call) which is return empty
foreach (Cart::getContent() as $item) {
if (($currentItem = Item::with('creator.country_info')->find($item->id))) {
$itemVat = round($vat * $item->price / 100, 2);
$subtotal += $item->price - $itemVat;
$vatTotal += $itemVat;
$items[] = [
'id' => $item->id,
'name' => $item->name,
'price' => $item->price,
'quantity' => $item->quantity,
'attributes' => $currentItem
];
}
}