mirror of
https://github.com/wearepixel/laravel-comments.git
synced 2026-11-14 14:02:04 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
972ff76c95 | ||
|
|
fe0e7865cb | ||
|
|
488c4076f9 | ||
|
|
cd2f65ed92 |
@@ -5,3 +5,5 @@ docs
|
|||||||
vendor
|
vendor
|
||||||
coverage
|
coverage
|
||||||
coverage.clover
|
coverage.clover
|
||||||
|
.phpunit.result.cache
|
||||||
|
.phpunit.cache/
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
filter:
|
|
||||||
excluded_paths: [tests/*]
|
|
||||||
|
|
||||||
checks:
|
|
||||||
php:
|
|
||||||
remove_extra_empty_lines: true
|
|
||||||
remove_php_closing_tag: true
|
|
||||||
remove_trailing_whitespace: true
|
|
||||||
fix_use_statements:
|
|
||||||
remove_unused: true
|
|
||||||
preserve_multiple: false
|
|
||||||
preserve_blanklines: true
|
|
||||||
order_alphabetically: true
|
|
||||||
fix_php_opening_tag: true
|
|
||||||
fix_linefeed: true
|
|
||||||
fix_line_ending: true
|
|
||||||
fix_identation_4spaces: true
|
|
||||||
fix_doc_comments: true
|
|
||||||
|
|
||||||
-21
@@ -1,21 +0,0 @@
|
|||||||
language: php
|
|
||||||
|
|
||||||
php:
|
|
||||||
- 7.2
|
|
||||||
- 7.3
|
|
||||||
- 7.4
|
|
||||||
|
|
||||||
env:
|
|
||||||
matrix:
|
|
||||||
- COMPOSER_FLAGS="--prefer-lowest"
|
|
||||||
- COMPOSER_FLAGS=""
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
- travis_retry composer self-update
|
|
||||||
- travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-source
|
|
||||||
|
|
||||||
script:
|
|
||||||
- vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
|
|
||||||
|
|
||||||
after_script:
|
|
||||||
- php vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover
|
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
# Add comments to your Laravel application
|
# Add comments to your Laravel application
|
||||||
|
|
||||||
[](https://packagist.org/packages/beyondcode/laravel-comments)
|
[](https://packagist.org/packages/beyondcode/laravel-comments)
|
||||||
[](https://travis-ci.org/beyondcode/laravel-comments)
|
|
||||||
[](https://scrutinizer-ci.com/g/beyondcode/laravel-comments)
|
|
||||||
[](https://packagist.org/packages/beyondcode/laravel-comments)
|
[](https://packagist.org/packages/beyondcode/laravel-comments)
|
||||||
|
|
||||||
Add the ability to associate comments to your Laravel Eloquent models. The comments can be approved and nested.
|
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
|
|||||||
*/
|
*/
|
||||||
public function needsCommentApproval($model): bool
|
public function needsCommentApproval($model): bool
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -139,6 +137,16 @@ $approved = $post->comments()->approved()->get();
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Nesting Comments
|
||||||
|
|
||||||
|
`BeyondCode\Comments\Comment` itself implements the `HasComments` trait, so you can comment on a comment and therefore nest them:
|
||||||
|
|
||||||
|
```php
|
||||||
|
$comment = BeyondCode\Comments\Comment::first();
|
||||||
|
$comment->commentAsUser($user, "Hey there!");
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
### Testing
|
### Testing
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@
|
|||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^7.2.5|^8.0",
|
"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|^10.0"
|
"illuminate/support": "~5.6.0|~5.7.0|~5.8.0|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"orchestra/testbench": "^3.6|^5.0|^6.0|^7.0|^8.0",
|
"orchestra/testbench": "^3.6|^5.0|^6.0|^7.0|^8.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user