From e24ede764a147387191874eb0c90d018f1a7bbd8 Mon Sep 17 00:00:00 2001 From: Serhii Date: Thu, 21 Nov 2019 19:05:06 +0200 Subject: [PATCH] upgrade laravel version to 6 --- .gitignore | 2 ++ composer.json | 8 ++------ src/Relations/BelongsToMany.php | 3 ++- src/Relations/MorphsToMany.php | 11 ++++++++++- 4 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5d45ad8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/.idea + diff --git a/composer.json b/composer.json index 19e2d86..0983604 100644 --- a/composer.json +++ b/composer.json @@ -3,12 +3,8 @@ "description": "Fully polymorphic pivot relations for laravel eloquent", "keywords": ["laravel", "relations", "polymorphic"], "require": { - "php": ">=5.6.4", - "illuminate/database": "^5.0,<5.7" - }, - "require-dev": { - "phpunit/phpunit": "~5.4.0", - "mockery/mockery": "^0.9.5" + "php": ">=7.1.3", + "illuminate/database": "~6.0" }, "autoload": { "psr-4": { diff --git a/src/Relations/BelongsToMany.php b/src/Relations/BelongsToMany.php index c6a7f58..d601e1f 100755 --- a/src/Relations/BelongsToMany.php +++ b/src/Relations/BelongsToMany.php @@ -3,6 +3,7 @@ namespace Pisochek\PivotPolymorph\Relations; use Illuminate\Database\Eloquent\Relations\BelongsToMany as IlluminateBelongsToMany; +use Illuminate\Support\Arr; class BelongsToMany extends IlluminateBelongsToMany { @@ -38,7 +39,7 @@ public function detach($ids = null, $touch = true) public function events(array $events) { - $this->events = array_only(array_merge($this->events, $events), array_keys($this->events)); + $this->events = Arr::only(array_merge($this->events, $events), array_keys($this->events)); return $this; } diff --git a/src/Relations/MorphsToMany.php b/src/Relations/MorphsToMany.php index 9a7aa30..60d13df 100644 --- a/src/Relations/MorphsToMany.php +++ b/src/Relations/MorphsToMany.php @@ -57,7 +57,16 @@ public function __construct( $this->relatedMorphClass = $query->getModel()->getMorphClass(); parent::__construct( - $query, $parent, $name, $table, $foreignPivotKey, $relatedPivotKey, $parentKey, $relatedKey, null, false + $query, + $parent, + $name, + $table, + $foreignPivotKey, + $relatedPivotKey, + $parentKey, + $relatedKey, + null, + false ); }