From bcc43079e36679e81fc7e766efdd017ca2f31955 Mon Sep 17 00:00:00 2001 From: Dan Tomlinson Date: Fri, 6 Sep 2019 16:47:53 +0100 Subject: [PATCH 1/3] Updated composer.json to allow Laravel 6.0 dependencies --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 23a9b02..afe96ff 100644 --- a/composer.json +++ b/composer.json @@ -16,9 +16,9 @@ } ], "require": { - "illuminate/support": "5.4.*||5.5.*||5.6.*||5.7.*||5.8.*", - "illuminate/session": "5.4.*||5.5.*||5.6.*||5.7.*||5.8.*", - "illuminate/events": "5.4.*||5.5.*||5.6.*||5.7.*||5.8.*" + "illuminate/support": "5.4.*||5.5.*||5.6.*||5.7.*||5.8.*||6.0.*", + "illuminate/session": "5.4.*||5.5.*||5.6.*||5.7.*||5.8.*||6.0.*", + "illuminate/events": "5.4.*||5.5.*||5.6.*||5.7.*||5.8.*||6.0.*" }, "require-dev": { "phpunit/phpunit": "~5.0||~6.0||~7.0||~8.0", From 7401f5bbb171caa91ba3a20443085f6f2d85f214 Mon Sep 17 00:00:00 2001 From: Dan Tomlinson Date: Fri, 6 Sep 2019 16:49:42 +0100 Subject: [PATCH 2/3] Replaced array_get with Arr::get as the helper method has been removed in 6.0 --- src/CartItem.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/CartItem.php b/src/CartItem.php index 16b448b..579c6b6 100644 --- a/src/CartItem.php +++ b/src/CartItem.php @@ -5,6 +5,7 @@ namespace Gloudemans\Shoppingcart; use Gloudemans\Shoppingcart\Contracts\Buyable; use Illuminate\Contracts\Support\Arrayable; use Illuminate\Contracts\Support\Jsonable; +use Illuminate\Support\Arr; class CartItem implements Arrayable, Jsonable { @@ -289,13 +290,13 @@ class CartItem implements Arrayable, Jsonable */ public function updateFromArray(array $attributes) { - $this->id = array_get($attributes, 'id', $this->id); - $this->qty = array_get($attributes, 'qty', $this->qty); - $this->name = array_get($attributes, 'name', $this->name); - $this->price = array_get($attributes, 'price', $this->price); - $this->weight = array_get($attributes, 'weight', $this->weight); + $this->id = Arr::get($attributes, 'id', $this->id); + $this->qty = Arr::get($attributes, 'qty', $this->qty); + $this->name = Arr::get($attributes, 'name', $this->name); + $this->price = Arr::get($attributes, 'price', $this->price); + $this->weight = Arr::get($attributes, 'weight', $this->weight); $this->priceTax = $this->price + $this->tax; - $this->options = new CartItemOptions(array_get($attributes, 'options', $this->options)); + $this->options = new CartItemOptions(Arr::get($attributes, 'options', $this->options)); $this->rowId = $this->generateRowId($this->id, $this->options->all()); } @@ -412,7 +413,7 @@ class CartItem implements Arrayable, Jsonable */ public static function fromArray(array $attributes) { - $options = array_get($attributes, 'options', []); + $options = Arr::get($attributes, 'options', []); return new self($attributes['id'], $attributes['name'], $attributes['price'], $attributes['weight'], $options); } From 6f9aace218d5841817026f98290d672b2ac0b83d Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 6 Sep 2019 18:00:29 +0200 Subject: [PATCH 3/3] Updated Laravel version in the readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b77ead2..3481422 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ [![Latest Unstable Version](https://poser.pugx.org/bumbummen99/shoppingcart/v/unstable)](https://packagist.org/packages/bumbummen99/shoppingcart) [![License](https://poser.pugx.org/bumbummen99/shoppingcart/license)](https://packagist.org/packages/bumbummen99/shoppingcart) -This is a fork of [Crisane's LaravelShoppingcart](https://github.com/Crinsane/LaravelShoppingcart) extended with minor features compatible with Laravel 5.8. +This is a fork of [Crisane's LaravelShoppingcart](https://github.com/Crinsane/LaravelShoppingcart) extended with minor features compatible with Laravel 6. ## Installation