diff --git a/.travis.yml b/.travis.yml index e4cd2e7..409853b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ language: php php: - - 5.6 - - 7.0 + - 7.1 + - 7.2 sudo: false diff --git a/README.md b/README.md index 21f314e..1a70937 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,7 @@ First, install the package through Composer. composer require hootlex/laravel-moderation ``` -Then include the service provider inside `config/app.php`. - +If you are using Laravel < 5.5, you need to add Hootlex\Moderation\ModerationServiceProvider to your `config/app.php` providers array: ```php 'providers' => [ ... diff --git a/composer.json b/composer.json index 5dc4872..fa809a2 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,12 @@ { "name": "hootlex/laravel-moderation", "description": "A simple Content Moderation System for Laravel 5.* that allows you to Approve or Reject resources like posts, comments, users, etc.", - "keywords": ["laravel", "moderation", "moderation-system", "content-moderation"], + "keywords": [ + "laravel", + "moderation", + "moderation-system", + "content-moderation" + ], "license": "MIT", "authors": [ { @@ -19,12 +24,20 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit" : "5.*", - "laravel/laravel": "5.*" + "phpunit/phpunit": "7.0", + "laravel/laravel": "5.*", + "nunomaduro/collision": "^2.0" }, "autoload": { "psr-4": { "Hootlex\\Moderation\\": "src/" } + }, + "extra": { + "laravel": { + "providers": [ + "Hootlex\\Moderation\\ModerationServiceProvider" + ] + } } } diff --git a/src/ModerationScope.php b/src/ModerationScope.php index 51f6018..6bd0f74 100644 --- a/src/ModerationScope.php +++ b/src/ModerationScope.php @@ -317,7 +317,7 @@ protected function addPend(Builder $builder) */ protected function getStatusColumn(Builder $builder) { - if (count($builder->getQuery()->joins) > 0) { + if ($builder->getQuery()->joins && count($builder->getQuery()->joins) > 0) { return $builder->getModel()->getQualifiedStatusColumn(); } else { return $builder->getModel()->getStatusColumn(); diff --git a/tests/ModerationScopeTest.php b/tests/ModerationScopeTest.php index dda57f9..a31fa6a 100644 --- a/tests/ModerationScopeTest.php +++ b/tests/ModerationScopeTest.php @@ -68,12 +68,6 @@ public function it_returns_only_pending_stories() } } - /** @test */ - public function it_returns_only_postponed_stories() - { - - } - /** @test */ public function it_returns_stories_including_pending_ones() {