4 Commits
Author SHA1 Message Date
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
4 changed files with 14 additions and 4 deletions
+1 -1
View File
@@ -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
View File
@@ -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",
+10 -1
View File
@@ -43,6 +43,15 @@ class Comment extends Model
return $this;
}
public function disapprove()
{
$this->update([
'is_approved' => false,
]);
return $this;
}
protected function getAuthModelName()
{
@@ -57,4 +66,4 @@ class Comment extends Model
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
{
public function setUp()
public function setUp(): void
{
parent::setUp();
$this->loadLaravelMigrations(['--database' => 'sqlite']);