diff --git a/.scrutinizer.yml b/.scrutinizer.yml index f235dc0..4e48850 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -28,4 +28,4 @@ checks: tools: external_code_coverage: timeout: 600 - runs: 2 + runs: 1 diff --git a/composer.json b/composer.json index f1ffb9b..fcb9162 100644 --- a/composer.json +++ b/composer.json @@ -16,11 +16,11 @@ ], "require": { "php": "^7.1.3", - "illuminate/database": "~5.5.0|~5.6.0|~5.7.0" + "illuminate/database": "~5.5.0|~5.6.0|~5.7.0|~5.8.0" }, "require-dev": { "phpunit/phpunit": "^7.4", - "orchestra/testbench": "~3.5.0|~3.6.0|~3.7.0", + "orchestra/testbench": "~3.5.0|~3.6.0|~3.7.0|~3.8.0", "fzaninotto/faker": "^1.8", "scrutinizer/ocular": "^1.5" }, diff --git a/src/CanComment.php b/src/CanComment.php index 325663b..f42fd26 100644 --- a/src/CanComment.php +++ b/src/CanComment.php @@ -18,7 +18,7 @@ public function comment(Commentable $commentable, string $commentText = '', int 'rate' => $commentable->canBeRated() ? $rate : null, 'approved' => $commentable->mustBeApproved() && !$this->canCommentWithoutApprove() ? false : true, 'commented_id' => $this->primaryId(), - 'commented_type' => get_class(), + 'commented_type' => $this->getMorphClass(), ]); $commentable->comments()->save($comment); @@ -41,7 +41,7 @@ public function hasCommentsOn(Commentable $commentable): bool return $this->comments() ->where([ 'commentable_id' => $commentable->primaryId(), - 'commentable_type' => get_class($commentable), + 'commentable_type' => $commentable->getMorphClass(), ]) ->exists(); }