@@ -26,7 +26,6 @@ For Laravel 5.5, 5.6, or 5.7~:
2626## CONFIGURATION
2727
28281 . Open config/app.php and add this line to your Service Providers Array.
29- NOTE: If you are using laravel 5.5 or above, this will be automatically added by its auto discovery.
3029
3130``` php
3231Darryldecode\Cart\CartServiceProvider::class
@@ -69,7 +68,7 @@ $rowId = 456; // generate a unique() row ID
6968$userID = 2; // the user ID to bind the cart contents
7069
7170// add the product to cart
72- Cart::session($userID)->add(array(
71+ \ Cart::session($userID)->add(array(
7372 'id' => $rowId,
7473 'name' => $Product->name,
7574 'price' => $Product->price,
@@ -79,26 +78,26 @@ Cart::session($userID)->add(array(
7978));
8079
8180// update the item on cart
82- Cart::session($userID)->update($rowId,[
81+ \ Cart::session($userID)->update($rowId,[
8382 'quantity' => 2,
8483 'price' => 98.67
8584]);
8685
8786// delete an item on cart
88- Cart::session($userID)->remove($rowId);
87+ \ Cart::session($userID)->remove($rowId);
8988
9089// view the cart items
91- $items = Cart::getContent();
90+ $items = \ Cart::getContent();
9291foreach($items as $row) {
9392
9493 echo $row->id; // row ID
9594 echo $row->name;
9695 echo $row->qty;
9796 echo $row->price;
9897
99- echo $row->model ->id; // whatever properties your model have
100- echo $row->model ->name; // whatever properties your model have
101- echo $row->model ->description; // whatever properties your model have
98+ echo $item->associatedModel ->id; // whatever properties your model have
99+ echo $item->associatedModel ->name; // whatever properties your model have
100+ echo $item->associatedModel ->description; // whatever properties your model have
102101}
103102
104103// FOR FULL USAGE, SEE BELOW..
0 commit comments