Skip to content

Commit 67b617d

Browse files
Force update To Support Laravel 10 (#5)
1 parent 768b00f commit 67b617d

File tree

6 files changed

+44
-50
lines changed

6 files changed

+44
-50
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All Notable changes to `laravel-reactions` will be documented in this file.
44

55
Updates are following the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
66

7+
## 1.1.0 - 2023-10-19
8+
9+
### Added
10+
11+
-
12+
- Add support of Laravel 10;
13+
-
714
## 0.1.1 - 2017-03-26
815

916
### Added

composer.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,15 @@
2222
}
2323
],
2424
"require": {
25-
"php" : "^7.2|^8.0",
26-
"illuminate/database": "~5.5|~5.6|~5.7|~5.8|^6.0|^7.0|^8.0|^9.0",
27-
"illuminate/support": "~5.5|~5.6|~5.7|~5.8|^6.0|^7.0|^8.0|^9.0"
25+
"php" : "^8.1|^8.2",
26+
"illuminate/database": "^9.0|^10.0",
27+
"illuminate/support": "^9.0|^10.0"
2828
},
2929
"require-dev": {
30-
"friendsofphp/php-cs-fixer": "^2.10",
31-
"mockery/mockery": "^1.0",
32-
"orchestra/database": "~3.5.0|~3.6.0|~3.7.0|~3.8.0|^4.0",
33-
"orchestra/testbench": "~3.5.0|~3.6.0|~3.7.0|~3.8.0|^4.0",
34-
"phpunit/phpunit": "^7.5|^8.0|^8.5"
30+
"friendsofphp/php-cs-fixer": "^3.35",
31+
"mockery/mockery": "^1.6",
32+
"orchestra/testbench": "^8.0",
33+
"phpunit/phpunit": "^9.5.0"
3534
},
3635
"autoload": {
3736
"psr-4": {

phpunit.xml

Lines changed: 22 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,24 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit bootstrap="vendor/autoload.php"
3-
backupGlobals="false"
4-
backupStaticAttributes="false"
5-
colors="true"
6-
verbose="true"
7-
convertErrorsToExceptions="true"
8-
convertNoticesToExceptions="true"
9-
convertWarningsToExceptions="true"
10-
processIsolation="false"
11-
stopOnFailure="false">
12-
<testsuites>
13-
<testsuite name="unit">
14-
<directory>tests/Unit</directory>
15-
</testsuite>
16-
<testsuite name="integration">
17-
<directory>tests/Integration</directory>
18-
</testsuite>
19-
</testsuites>
20-
<filter>
21-
<whitelist>
22-
<directory suffix=".php">src/</directory>
23-
</whitelist>
24-
</filter>
25-
<logging>
26-
<log type="tap" target="build/report.tap"/>
27-
<log type="junit" target="build/report.junit.xml"/>
28-
<log type="coverage-html" target="build/coverage"/>
29-
<log type="coverage-text" target="build/coverage.txt"/>
30-
<log type="coverage-clover" target="build/logs/clover.xml"/>
31-
</logging>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" backupStaticAttributes="false" colors="true" verbose="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3+
<coverage>
4+
<include>
5+
<directory suffix=".php">src/</directory>
6+
</include>
7+
<report>
8+
<clover outputFile="build/logs/clover.xml"/>
9+
<html outputDirectory="build/coverage"/>
10+
<text outputFile="build/coverage.txt"/>
11+
</report>
12+
</coverage>
13+
<testsuites>
14+
<testsuite name="unit">
15+
<directory>tests/Unit</directory>
16+
</testsuite>
17+
<testsuite name="integration">
18+
<directory>tests/Integration</directory>
19+
</testsuite>
20+
</testsuites>
21+
<logging>
22+
<junit outputFile="build/report.junit.xml"/>
23+
</logging>
3224
</phpunit>

src/Migrations/2017_03_25_141250_create_reactions_table.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ class CreateReactionsTable extends Migration
1414
public function up()
1515
{
1616
Schema::create('reactions', function (Blueprint $table) {
17-
$table->increments('id');
17+
$table->id();
18+
$table->uuid()->nullable();
1819

1920
$table->string('name');
2021

src/Migrations/2017_03_25_142853_create_reactables_table.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ class CreateReactablesTable extends Migration
1414
public function up()
1515
{
1616
Schema::create('reactables', function (Blueprint $table) {
17-
$table->increments('id');
17+
$table->id();
1818

19-
$table->integer('reaction_id');
20-
$table->integer('reactable_id');
21-
$table->string('reactable_type');
19+
$table->unsignedInteger('reaction_id');
2220

23-
$table->integer('responder_id');
24-
$table->string('responder_type');
21+
$table->morphs('reactable');
22+
$table->morphs('responder');
2523
});
2624
}
2725

src/Traits/Reactable.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77

88
trait Reactable
99
{
10-
/**
11-
* @return MorphToMany
12-
*/
13-
public function reactions()
10+
11+
public function reactions(): MorphToMany
1412
{
1513
/** @var $this Model */
1614
return $this->morphToMany('DevDojo\\LaravelReactions\\Models\\Reaction', 'reactable')
@@ -38,6 +36,5 @@ public function reacted($responder = null)
3836
return $this->reactions()
3937
->where('responder_id', $responder->id)
4038
->where('responder_type', get_class($responder))->exists();
41-
4239
}
4340
}

0 commit comments

Comments
 (0)