mirror of
https://github.com/wearepixel/laravel-comments.git
synced 2026-11-14 22:12:35 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c7d599349d | ||
|
|
faeb83b7d2 | ||
|
|
e8b5b7a237 | ||
|
|
7bbc024302 |
@@ -52,8 +52,8 @@ To let your models be able to receive comments, add the `HasComments` trait to t
|
||||
``` php
|
||||
namespace App\Models;
|
||||
|
||||
use Beyondcode\Comments\HasComments;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use BeyondCode\Comments\Traits\HasComments;
|
||||
|
||||
class Post extends Model
|
||||
{
|
||||
|
||||
+2
-1
@@ -17,7 +17,8 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": "^7.1"
|
||||
"php": "^7.1",
|
||||
"illuminate/support": "~5.6.0|~5.7.0|~5.8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"orchestra/testbench": "^3.6",
|
||||
|
||||
@@ -44,6 +44,15 @@ class Comment extends Model
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function disapprove()
|
||||
{
|
||||
$this->update([
|
||||
'is_approved' => false,
|
||||
]);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
protected function getAuthModelName()
|
||||
{
|
||||
if (config('comments.user_model')) {
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ use BeyondCode\Comments\CommentsServiceProvider;
|
||||
abstract class TestCase extends \Orchestra\Testbench\TestCase
|
||||
{
|
||||
|
||||
public function setUp()
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->loadLaravelMigrations(['--database' => 'sqlite']);
|
||||
|
||||
Reference in New Issue
Block a user