diff --git a/CHANGELOG.md b/CHANGELOG.md index dbdf211..d8200e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ All Notable changes to `laravel-reactions` will be documented in this file. Updates are following the [Keep a CHANGELOG](http://keepachangelog.com/) principles. +## 1.1.0 - 2023-10-19 + +### Added + +- +- Add support of Laravel 10; +- ## 0.1.1 - 2017-03-26 ### Added diff --git a/composer.json b/composer.json index 5c571e1..a718433 100644 --- a/composer.json +++ b/composer.json @@ -22,16 +22,15 @@ } ], "require": { - "php" : "^7.2|^8.0", - "illuminate/database": "~5.5|~5.6|~5.7|~5.8|^6.0|^7.0|^8.0|^9.0", - "illuminate/support": "~5.5|~5.6|~5.7|~5.8|^6.0|^7.0|^8.0|^9.0" + "php" : "^8.1|^8.2", + "illuminate/database": "^9.0|^10.0", + "illuminate/support": "^9.0|^10.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.10", - "mockery/mockery": "^1.0", - "orchestra/database": "~3.5.0|~3.6.0|~3.7.0|~3.8.0|^4.0", - "orchestra/testbench": "~3.5.0|~3.6.0|~3.7.0|~3.8.0|^4.0", - "phpunit/phpunit": "^7.5|^8.0|^8.5" + "friendsofphp/php-cs-fixer": "^3.35", + "mockery/mockery": "^1.6", + "orchestra/testbench": "^8.0", + "phpunit/phpunit": "^9.5.0" }, "autoload": { "psr-4": { diff --git a/phpunit.xml b/phpunit.xml index c4ae2cf..a933d49 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,32 +1,24 @@ - - - - tests/Unit - - - tests/Integration - - - - - src/ - - - - - - - - - + + + + src/ + + + + + + + + + + tests/Unit + + + tests/Integration + + + + + diff --git a/src/Migrations/2017_03_25_141250_create_reactions_table.php b/src/Migrations/2017_03_25_141250_create_reactions_table.php index 665de5e..7a40627 100644 --- a/src/Migrations/2017_03_25_141250_create_reactions_table.php +++ b/src/Migrations/2017_03_25_141250_create_reactions_table.php @@ -14,7 +14,8 @@ class CreateReactionsTable extends Migration public function up() { Schema::create('reactions', function (Blueprint $table) { - $table->increments('id'); + $table->id(); + $table->uuid()->nullable(); $table->string('name'); diff --git a/src/Migrations/2017_03_25_142853_create_reactables_table.php b/src/Migrations/2017_03_25_142853_create_reactables_table.php index 8602e59..68a3bd3 100644 --- a/src/Migrations/2017_03_25_142853_create_reactables_table.php +++ b/src/Migrations/2017_03_25_142853_create_reactables_table.php @@ -14,14 +14,12 @@ class CreateReactablesTable extends Migration public function up() { Schema::create('reactables', function (Blueprint $table) { - $table->increments('id'); + $table->id(); - $table->integer('reaction_id'); - $table->integer('reactable_id'); - $table->string('reactable_type'); + $table->unsignedInteger('reaction_id'); - $table->integer('responder_id'); - $table->string('responder_type'); + $table->morphs('reactable'); + $table->morphs('responder'); }); } diff --git a/src/Traits/Reactable.php b/src/Traits/Reactable.php index 42cca1c..61e3ffb 100644 --- a/src/Traits/Reactable.php +++ b/src/Traits/Reactable.php @@ -7,10 +7,8 @@ trait Reactable { - /** - * @return MorphToMany - */ - public function reactions() + + public function reactions(): MorphToMany { /** @var $this Model */ return $this->morphToMany('DevDojo\\LaravelReactions\\Models\\Reaction', 'reactable') @@ -38,6 +36,5 @@ public function reacted($responder = null) return $this->reactions() ->where('responder_id', $responder->id) ->where('responder_type', get_class($responder))->exists(); - } }