You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
I need to get all carts from database and view their details with conditions and item details ?
when using eloquent model and get all carts pluck id to get the session id it returns a different number !
this is the logic I am trying to apply
public function getAll(){
$all_carts_in_db =CartStorage::get();
$carts=[];
foreach ($all_carts_in_db as $cart_in_db ){
$sessionKey=str_replace('_cart_items', '', $cart_in_db->id);
$carts[]= Cart::session($sessionKey);
}
return $carts;
}
the issue is the when I am trying to get the cart session key , $cart_in_db->id returns new number
the session Key I have entered is 51546e31-a956-4876-ab3d-33413d06d826-8g0W30LdUrk2hlte6zdbqCFMc6MyrmTM-c6daeb8549b1d1ce75ac4074d0ba305f
in database id is 51546e31-a956-4876-ab3d-33413d06d826-8g0W30LdUrk2hlte6zdbqCFMc6MyrmTM-c6daeb8549b1d1ce75ac4074d0ba305f_cart_items
the returned value from $cart_in_db->id is 9223372036854775807
I expected that $cart_in_db->id equals the id in the database
The text was updated successfully, but these errors were encountered:
Hi
I need to get all carts from database and view their details with conditions and item details ?
when using eloquent model and get all carts pluck id to get the session id it returns a different number !
this is the logic I am trying to apply
the issue is the when I am trying to get the cart session key , $cart_in_db->id returns new number
the session Key I have entered is 51546e31-a956-4876-ab3d-33413d06d826-8g0W30LdUrk2hlte6zdbqCFMc6MyrmTM-c6daeb8549b1d1ce75ac4074d0ba305f
in database id is 51546e31-a956-4876-ab3d-33413d06d826-8g0W30LdUrk2hlte6zdbqCFMc6MyrmTM-c6daeb8549b1d1ce75ac4074d0ba305f_cart_items
the returned value from $cart_in_db->id is 9223372036854775807
I expected that $cart_in_db->id equals the id in the database
The text was updated successfully, but these errors were encountered: