diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 512a47a..2880858 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -23,7 +23,7 @@ checks: tools: external_code_coverage: timeout: 600 - runs: 3 + runs: 2 php_code_sniffer: enabled: true config: diff --git a/.travis.yml b/.travis.yml index 095f38e..af2ae32 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,6 @@ language: php sudo: false php: - - 5.6 - 7.0 - 7.1 - nightly diff --git a/_docs/1-Installation-and-Setup.md b/_docs/1-Installation-and-Setup.md index 0c04408..052e49c 100644 --- a/_docs/1-Installation-and-Setup.md +++ b/_docs/1-Installation-and-Setup.md @@ -11,7 +11,7 @@ The Laravel Messenger package has a few system requirements: ``` -- PHP >= 5.6.4 +- PHP >= 7.0 ``` ## Version Compatibility @@ -20,14 +20,17 @@ The Laravel Messenger package has a few system requirements: |:------------------------------------------------|:---------------------------------------------------------------------------------------| | ![LaravelMessenger v1.x][laravel_messenger_1_x] | ![Laravel v5.1][laravel_5_1] ![Laravel v5.2][laravel_5_2] ![Laravel v5.3][laravel_5_3] | | ![LaravelMessenger v2.x][laravel_messenger_2_x] | ![Laravel v5.4][laravel_5_4] | +| ![LaravelMessenger v3.x][laravel_messenger_3_x] | ![Laravel v5.5][laravel_5_5] | [laravel_5_1]: https://img.shields.io/badge/v5.1-supported-brightgreen.svg?style=flat-square "Laravel v5.1" [laravel_5_2]: https://img.shields.io/badge/v5.2-supported-brightgreen.svg?style=flat-square "Laravel v5.2" [laravel_5_3]: https://img.shields.io/badge/v5.3-supported-brightgreen.svg?style=flat-square "Laravel v5.3" [laravel_5_4]: https://img.shields.io/badge/v5.4-supported-brightgreen.svg?style=flat-square "Laravel v5.4" +[laravel_5_5]: https://img.shields.io/badge/v5.5-supported-brightgreen.svg?style=flat-square "Laravel v5.5" [laravel_messenger_1_x]: https://img.shields.io/badge/version-1.*-blue.svg?style=flat-square "LaravelMessenger v1.*" [laravel_messenger_2_x]: https://img.shields.io/badge/version-2.*-blue.svg?style=flat-square "LaravelMessenger v2.*" +[laravel_messenger_3_x]: https://img.shields.io/badge/version-3.*-blue.svg?style=flat-square "LaravelMessenger v3.*" ## Composer @@ -37,6 +40,8 @@ You can install this package via [Composer](http://getcomposer.org/) by running ### Setup +> **NOTE :** The package will automatically register itself if you're using Laravel `>= v5.5`, so you can skip this section. + Once the package is installed, you can register the service provider in `config/app.php` in the `providers` array: ```php diff --git a/composer.json b/composer.json index b6246c2..cbb6678 100644 --- a/composer.json +++ b/composer.json @@ -16,14 +16,14 @@ "type": "library", "license": "MIT", "require": { - "php": ">=5.6.4", - "arcanedev/support": "~4.1.0" + "php": ">=7.0", + "arcanedev/support": "~4.2.0" }, "require-dev": { - "orchestra/testbench": "~3.4.0", - "orchestra/database": "~3.4.0", - "phpunit/phpcov": "~3.0", - "phpunit/phpunit": "~5.0" + "orchestra/testbench": "~3.5.0", + "orchestra/database": "~3.5.0", + "phpunit/phpcov": "~4.0", + "phpunit/phpunit": "~6.0" }, "autoload": { "psr-4": { @@ -34,5 +34,12 @@ "psr-4": { "Arcanedev\\LaravelMessenger\\Tests\\": "tests/" } + }, + "extra": { + "laravel": { + "providers": [ + "Arcanedev\\LaravelMessenger\\LaravelMessengerServiceProvider" + ] + } } } diff --git a/src/Traits/Messagable.php b/src/Traits/Messagable.php index 08b74a2..f6bde95 100644 --- a/src/Traits/Messagable.php +++ b/src/Traits/Messagable.php @@ -110,13 +110,15 @@ public function discussionsWithNewMessages() * * @param string $related * @param string $table - * @param string $foreignKey - * @param string $otherKey + * @param string $foreignPivotKey + * @param string $relatedPivotKey + * @param string $parentKey + * @param string $relatedKey * @param string $relation - * * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ - abstract public function belongsToMany($related, $table = null, $foreignKey = null, $otherKey = null, $relation = null); + abstract public function belongsToMany($related, $table = null, $foreignPivotKey = null, $relatedPivotKey = null, + $parentKey = null, $relatedKey = null, $relation = null); /** * Define a one-to-many relationship. diff --git a/tests/Models/DiscussionTest.php b/tests/Models/DiscussionTest.php index 184132e..d827ef8 100644 --- a/tests/Models/DiscussionTest.php +++ b/tests/Models/DiscussionTest.php @@ -347,7 +347,7 @@ public function it_can_skip_mark_last_read_if_participant_not_found() /** * @var \Arcanedev\LaravelMessenger\Models\Discussion $discussion */ $discussion = $this->factory->create(Discussion::class); - $discussion->markAsRead(10); + $this->assertFalse($discussion->markAsRead(10)); } /** @test */ diff --git a/tests/Stubs/Models/User.php b/tests/Stubs/Models/User.php index a0fecbd..65885c4 100644 --- a/tests/Stubs/Models/User.php +++ b/tests/Stubs/Models/User.php @@ -1,7 +1,7 @@