Storing Array Into HTTP Session
I am using HTTP Session to store the cart item for the user who never log in into the system which is guest.
I want to store those cart items into the HTTP Session as a array. How do I achieve this?
"cart_item" => array:1 [
"box" => array:2 [
"quantity" => 1,
"price" => 49.90
]
]
session([
'cart_item' => [
'box' => [
'quantity' => 1,
'price' => 49.90
]
]
]);
to get it from the session:
session('cart_item'); // i'm pretty sure this retrieves
session()->get('cart_item');
Please or to participate in this conversation.