Skip to content

Commit

Permalink
Force update To Support Laravel 10 (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
elmarzouguidev authored Nov 13, 2023
1 parent 768b00f commit 67b617d
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 50 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 7 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
52 changes: 22 additions & 30 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,32 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="unit">
<directory>tests/Unit</directory>
</testsuite>
<testsuite name="integration">
<directory>tests/Integration</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
<logging>
<log type="tap" target="build/report.tap"/>
<log type="junit" target="build/report.junit.xml"/>
<log type="coverage-html" target="build/coverage"/>
<log type="coverage-text" target="build/coverage.txt"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
<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">
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
<report>
<clover outputFile="build/logs/clover.xml"/>
<html outputDirectory="build/coverage"/>
<text outputFile="build/coverage.txt"/>
</report>
</coverage>
<testsuites>
<testsuite name="unit">
<directory>tests/Unit</directory>
</testsuite>
<testsuite name="integration">
<directory>tests/Integration</directory>
</testsuite>
</testsuites>
<logging>
<junit outputFile="build/report.junit.xml"/>
</logging>
</phpunit>
3 changes: 2 additions & 1 deletion src/Migrations/2017_03_25_141250_create_reactions_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
10 changes: 4 additions & 6 deletions src/Migrations/2017_03_25_142853_create_reactables_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
}

Expand Down
7 changes: 2 additions & 5 deletions src/Traits/Reactable.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -38,6 +36,5 @@ public function reacted($responder = null)
return $this->reactions()
->where('responder_id', $responder->id)
->where('responder_type', get_class($responder))->exists();

}
}

0 comments on commit 67b617d

Please sign in to comment.