mirror of
https://github.com/wearepixel/laravel-comments.git
synced 2026-11-14 22:12:35 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a49cde825e | ||
|
|
5d79013c09 | ||
|
|
f2d0b1f6b6 | ||
|
|
6ca48b89bf | ||
|
|
dd9d3c8d9f | ||
|
|
b366e1c636 | ||
|
|
b0b7f77cf7 | ||
|
|
31bfa04dcc | ||
|
|
7b5fca31b9 | ||
|
|
e7ff37cafe | ||
|
|
461094925d | ||
|
|
bf0eeb5579 | ||
|
|
f75584052f | ||
|
|
c7d599349d | ||
|
|
faeb83b7d2 | ||
|
|
e8b5b7a237 | ||
|
|
7bbc024302 |
@@ -4,3 +4,4 @@ composer.lock
|
|||||||
docs
|
docs
|
||||||
vendor
|
vendor
|
||||||
coverage
|
coverage
|
||||||
|
coverage.clover
|
||||||
|
|||||||
+2
-1
@@ -1,8 +1,9 @@
|
|||||||
language: php
|
language: php
|
||||||
|
|
||||||
php:
|
php:
|
||||||
- 7.1
|
|
||||||
- 7.2
|
- 7.2
|
||||||
|
- 7.3
|
||||||
|
- 7.4
|
||||||
|
|
||||||
env:
|
env:
|
||||||
matrix:
|
matrix:
|
||||||
|
|||||||
@@ -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
@@ -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
@@ -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>
|
||||||
|
|||||||
@@ -44,6 +44,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()
|
||||||
{
|
{
|
||||||
if (config('comments.user_model')) {
|
if (config('comments.user_model')) {
|
||||||
|
|||||||
+1
-1
@@ -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']);
|
||||||
|
|||||||
Reference in New Issue
Block a user