Skip to content

Instantly share code, notes, and snippets.

@da-n
Created September 28, 2016 23:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save da-n/be827d0161c5555c3e76e4ec247ba065 to your computer and use it in GitHub Desktop.
Save da-n/be827d0161c5555c3e76e4ec247ba065 to your computer and use it in GitHub Desktop.
Laravel insert into array $key => $value in a session
Session::put('cart', array_add($cart = Session::get('cart'), $product, $quantity));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment