17 Commits
Author SHA1 Message Date
Marcel Pociot a49cde825e Merge pull request #28 from laravel-shift/l9-compatibility
Laravel 9.x Compatibility
2022-02-14 12:24:46 +01:00
Shift 5d79013c09 Bump dependencies for Laravel 9 2022-02-01 18:34:05 +00:00
Marcel Pociot f2d0b1f6b6 Merge pull request #24 from Edgarborras94/master
Added PHP 8 to composer.json
2021-11-26 13:32:34 +01:00
Edgar Borrás Carcelén 6ca48b89bf PHP 8 version compatibility 2021-04-22 15:57:34 +02:00
Sebastian Schlein dd9d3c8d9f Merge pull request #19 from lukasmu/master
Added Laravel 8.0 support
2021-01-04 16:24:14 +01:00
Lukas Mueller b366e1c636 Added Laravel 8.0 support (along with some minor changes to the CI flow, fixes #18) 2020-10-02 22:57:45 +02:00
Marcel Pociot b0b7f77cf7 Merge pull request #14 from tkaratug/master
Add Laravel 7.0 support
2020-03-23 08:33:34 +01:00
Turan Karatug 31bfa04dcc Add Laravel 7.0 support 2020-03-10 09:54:31 +03:00
Marcel Pociot 7b5fca31b9 Merge pull request #7 from gdpa/hotfix/laravel58support
Add support for laravel 5.8 default bigIncrement
2019-10-06 23:03:41 +02:00
Marcel Pociot e7ff37cafe Merge pull request #11 from sammagee/master
Add Laravel 6.0 support
2019-10-06 23:03:30 +02:00
Sam 461094925d Remove PHP 7.1 from travis-ci build 2019-09-06 21:39:40 -05:00
Sam bf0eeb5579 Add Laravel 6.0 support 2019-09-06 21:35:50 -05:00
Morteza Poussaneh f75584052f Add support for laravel 5.8 default bigIncrement 2019-03-02 14:53:21 +03:30
Marcel Pociot c7d599349d Add Laravel 5.8 support 2019-02-28 14:36:52 +01:00
Marcel Pociot faeb83b7d2 Merge pull request #6 from nickbyte/master
Adding method for disapproving a comment
2019-02-28 14:27:11 +01:00
Nicholas Francis e8b5b7a237 Adding method for disapproving a comment 2019-02-13 15:50:16 +05:30
Marcel Pociot 7bbc024302 Update README.md 2018-12-12 22:19:44 +01:00
8 changed files with 22 additions and 12 deletions
+2 -1
View File
@@ -3,4 +3,5 @@ build
composer.lock composer.lock
docs docs
vendor vendor
coverage coverage
coverage.clover
+2 -1
View File
@@ -1,8 +1,9 @@
language: php language: php
php: php:
- 7.1
- 7.2 - 7.2
- 7.3
- 7.4
env: env:
matrix: matrix:
+1 -1
View File
@@ -52,8 +52,8 @@ To let your models be able to receive comments, add the `HasComments` trait to t
``` php ``` php
namespace App\Models; namespace App\Models;
use Beyondcode\Comments\HasComments;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use BeyondCode\Comments\Traits\HasComments;
class Post extends Model class Post extends Model
{ {
+4 -4
View File
@@ -17,11 +17,12 @@
} }
], ],
"require": { "require": {
"php": "^7.1" "php": "^7.2.5|^8.0",
"illuminate/support": "~5.6.0|~5.7.0|~5.8.0|^6.0|^7.0|^8.0|^9.0"
}, },
"require-dev": { "require-dev": {
"orchestra/testbench": "^3.6", "orchestra/testbench": "^3.6|^5.0|^6.0|^7.0",
"phpunit/phpunit": "^7.0" "phpunit/phpunit": "^7.0|^8.0|9.2.*|^9.5.10"
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
@@ -36,7 +37,6 @@
"scripts": { "scripts": {
"test": "vendor/bin/phpunit", "test": "vendor/bin/phpunit",
"test-coverage": "vendor/bin/phpunit --coverage-html coverage" "test-coverage": "vendor/bin/phpunit --coverage-html coverage"
}, },
"config": { "config": {
"sort-packages": true "sort-packages": true
@@ -16,7 +16,7 @@ class CreateCommentsTable extends Migration
$table->morphs('commentable'); $table->morphs('commentable');
$table->text('comment'); $table->text('comment');
$table->boolean('is_approved')->default(false); $table->boolean('is_approved')->default(false);
$table->unsignedInteger('user_id')->nullable(); $table->unsignedBigInteger('user_id')->nullable();
$table->timestamps(); $table->timestamps();
}); });
} }
+1 -2
View File
@@ -20,9 +20,8 @@
</whitelist> </whitelist>
</filter> </filter>
<logging> <logging>
<log type="tap" target="build/report.tap"/>
<log type="junit" target="build/report.junit.xml"/> <log type="junit" target="build/report.junit.xml"/>
<log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/> <log type="coverage-html" target="build/coverage" />
<log type="coverage-text" target="build/coverage.txt"/> <log type="coverage-text" target="build/coverage.txt"/>
<log type="coverage-clover" target="build/logs/clover.xml"/> <log type="coverage-clover" target="build/logs/clover.xml"/>
</logging> </logging>
+10 -1
View File
@@ -43,6 +43,15 @@ class Comment extends Model
return $this; return $this;
} }
public function disapprove()
{
$this->update([
'is_approved' => false,
]);
return $this;
}
protected function getAuthModelName() protected function getAuthModelName()
{ {
@@ -57,4 +66,4 @@ class Comment extends Model
throw new Exception('Could not determine the commentator model name.'); throw new Exception('Could not determine the commentator model name.');
} }
} }
+1 -1
View File
@@ -9,7 +9,7 @@ use BeyondCode\Comments\CommentsServiceProvider;
abstract class TestCase extends \Orchestra\Testbench\TestCase abstract class TestCase extends \Orchestra\Testbench\TestCase
{ {
public function setUp() public function setUp(): void
{ {
parent::setUp(); parent::setUp();
$this->loadLaravelMigrations(['--database' => 'sqlite']); $this->loadLaravelMigrations(['--database' => 'sqlite']);