Skip to content

Commit

Permalink
Merge pull request #2 from omaximus/upgrade-laravel-to-6
Browse files Browse the repository at this point in the history
upgrade laravel version to 6
  • Loading branch information
omaximus authored Nov 22, 2019
2 parents e4ff667 + e24ede7 commit 4c65d2b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.idea

8 changes: 2 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
3 changes: 2 additions & 1 deletion src/Relations/BelongsToMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Pisochek\PivotPolymorph\Relations;

use Illuminate\Database\Eloquent\Relations\BelongsToMany as IlluminateBelongsToMany;
use Illuminate\Support\Arr;

class BelongsToMany extends IlluminateBelongsToMany
{
Expand Down Expand Up @@ -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;
}
Expand Down
11 changes: 10 additions & 1 deletion src/Relations/MorphsToMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}

Expand Down

0 comments on commit 4c65d2b

Please sign in to comment.