Skip to content

Commit 972ff76

Browse files
authored
Merge pull request #38 from beyondcode/laravel-11
Laravel 11 compatibility
2 parents b5569cc + fe0e786 commit 972ff76

File tree

5 files changed

+15
-45
lines changed

5 files changed

+15
-45
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ docs
55
vendor
66
coverage
77
coverage.clover
8+
.phpunit.result.cache
9+
.phpunit.cache/

.scrutinizer.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Add comments to your Laravel application
22

33
[![Latest Version on Packagist](https://img.shields.io/packagist/v/beyondcode/laravel-comments.svg?style=flat-square)](https://packagist.org/packages/beyondcode/laravel-comments)
4-
[![Build Status](https://img.shields.io/travis/beyondcode/laravel-comments/master.svg?style=flat-square)](https://travis-ci.org/beyondcode/laravel-comments)
5-
[![Quality Score](https://img.shields.io/scrutinizer/g/beyondcode/laravel-comments.svg?style=flat-square)](https://scrutinizer-ci.com/g/beyondcode/laravel-comments)
64
[![Total Downloads](https://img.shields.io/packagist/dt/beyondcode/laravel-comments.svg?style=flat-square)](https://packagist.org/packages/beyondcode/laravel-comments)
75

86
Add the ability to associate comments to your Laravel Eloquent models. The comments can be approved and nested.
@@ -115,9 +113,9 @@ class User extends Authenticatable implements Commentator
115113
*/
116114
public function needsCommentApproval($model): bool
117115
{
118-
return false;
116+
return false;
119117
}
120-
118+
121119
}
122120
```
123121

@@ -139,6 +137,16 @@ $approved = $post->comments()->approved()->get();
139137

140138
```
141139

140+
### Nesting Comments
141+
142+
`BeyondCode\Comments\Comment` itself implements the `HasComments` trait, so you can comment on a comment and therefore nest them:
143+
144+
```php
145+
$comment = BeyondCode\Comments\Comment::first();
146+
$comment->commentAsUser($user, "Hey there!");
147+
```
148+
149+
142150
### Testing
143151

144152
``` bash

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
],
1919
"require": {
2020
"php": "^7.2.5|^8.0",
21-
"illuminate/support": "~5.6.0|~5.7.0|~5.8.0|^6.0|^7.0|^8.0|^9.0|^10.0"
21+
"illuminate/support": "~5.6.0|~5.7.0|~5.8.0|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0"
2222
},
2323
"require-dev": {
2424
"orchestra/testbench": "^3.6|^5.0|^6.0|^7.0|^8.0",

0 commit comments

Comments
 (0)