From cd2f65ed92110f03fd3aa7fcb44d1ba86d7097c5 Mon Sep 17 00:00:00 2001 From: Di Date: Tue, 13 Feb 2024 18:03:03 +0100 Subject: [PATCH 1/3] Added example for nesting comments to Readme --- README.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ecb1059..3296d3c 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ # Add comments to your Laravel application [![Latest Version on Packagist](https://img.shields.io/packagist/v/beyondcode/laravel-comments.svg?style=flat-square)](https://packagist.org/packages/beyondcode/laravel-comments) -[![Build Status](https://img.shields.io/travis/beyondcode/laravel-comments/master.svg?style=flat-square)](https://travis-ci.org/beyondcode/laravel-comments) -[![Quality Score](https://img.shields.io/scrutinizer/g/beyondcode/laravel-comments.svg?style=flat-square)](https://scrutinizer-ci.com/g/beyondcode/laravel-comments) [![Total Downloads](https://img.shields.io/packagist/dt/beyondcode/laravel-comments.svg?style=flat-square)](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. @@ -115,9 +113,9 @@ class User extends Authenticatable implements Commentator */ 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 ``` bash From 488c4076f97e7f1d5ef547cf17bbdc145c7d94ab Mon Sep 17 00:00:00 2001 From: Di Date: Tue, 13 Feb 2024 18:03:14 +0100 Subject: [PATCH 2/3] Updated dependencies for Laravel 11 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ff325d2..24bb795 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ ], "require": { "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": { "orchestra/testbench": "^3.6|^5.0|^6.0|^7.0|^8.0", From fe0e7865cbbdcab75d48a34f7135cacb6e7b5947 Mon Sep 17 00:00:00 2001 From: Di Date: Tue, 13 Feb 2024 18:09:14 +0100 Subject: [PATCH 3/3] wip --- .gitignore | 2 ++ .scrutinizer.yml | 19 ------------------- .travis.yml | 21 --------------------- 3 files changed, 2 insertions(+), 40 deletions(-) delete mode 100644 .scrutinizer.yml delete mode 100644 .travis.yml diff --git a/.gitignore b/.gitignore index a9f4f8d..443678c 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ docs vendor coverage coverage.clover +.phpunit.result.cache +.phpunit.cache/ \ No newline at end of file diff --git a/.scrutinizer.yml b/.scrutinizer.yml deleted file mode 100644 index df16b68..0000000 --- a/.scrutinizer.yml +++ /dev/null @@ -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 - diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9a5988c..0000000 --- a/.travis.yml +++ /dev/null @@ -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