14 Commits
Author SHA1 Message Date
Di 972ff76c95 Merge pull request #38 from beyondcode/laravel-11
Laravel 11 compatibility
2024-03-13 17:03:05 +01:00
Di fe0e7865cb wip 2024-02-13 18:09:14 +01:00
Di 488c4076f9 Updated dependencies for Laravel 11 2024-02-13 18:03:14 +01:00
Di cd2f65ed92 Added example for nesting comments to Readme 2024-02-13 18:03:03 +01:00
Di b5569cce2b Merge pull request #32 from laravel-shift/l10-compatibility
Laravel 10.x Compatibility
2023-11-20 17:06:20 +01:00
Shift 584d1e5cee Bump dependencies for Laravel 10 2023-01-31 19:48:33 +00:00
Marcel Pociot a49cde825e Merge pull request #28 from laravel-shift/l9-compatibility
Laravel 9.x Compatibility
2022-02-14 12:24:46 +01:00
Shift 5d79013c09 Bump dependencies for Laravel 9 2022-02-01 18:34:05 +00:00
Marcel Pociot f2d0b1f6b6 Merge pull request #24 from Edgarborras94/master
Added PHP 8 to composer.json
2021-11-26 13:32:34 +01:00
Edgar Borrás Carcelén 6ca48b89bf PHP 8 version compatibility 2021-04-22 15:57:34 +02:00
Sebastian Schlein dd9d3c8d9f Merge pull request #19 from lukasmu/master
Added Laravel 8.0 support
2021-01-04 16:24:14 +01:00
Lukas Mueller b366e1c636 Added Laravel 8.0 support (along with some minor changes to the CI flow, fixes #18) 2020-10-02 22:57:45 +02:00
Marcel Pociot b0b7f77cf7 Merge pull request #14 from tkaratug/master
Add Laravel 7.0 support
2020-03-23 08:33:34 +01:00
Turan Karatug 31bfa04dcc Add Laravel 7.0 support 2020-03-10 09:54:31 +03:00
6 changed files with 21 additions and 50 deletions
+4 -1
View File
@@ -3,4 +3,7 @@ build
composer.lock composer.lock
docs docs
vendor vendor
coverage coverage
coverage.clover
.phpunit.result.cache
.phpunit.cache/
-19
View File
@@ -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
-19
View File
@@ -1,19 +0,0 @@
language: php
php:
- 7.2
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
+12 -4
View File
@@ -1,8 +1,6 @@
# Add comments to your Laravel application # 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) [![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) [![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. 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
+4 -5
View File
@@ -17,12 +17,12 @@
} }
], ],
"require": { "require": {
"php": "^7.2", "php": "^7.2.5|^8.0",
"illuminate/support": "~5.6.0|~5.7.0|~5.8.0|^6.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", "orchestra/testbench": "^3.6|^5.0|^6.0|^7.0|^8.0",
"phpunit/phpunit": "^7.0" "phpunit/phpunit": "^7.0|^8.0|9.2.*|^9.5.10"
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
@@ -37,7 +37,6 @@
"scripts": { "scripts": {
"test": "vendor/bin/phpunit", "test": "vendor/bin/phpunit",
"test-coverage": "vendor/bin/phpunit --coverage-html coverage" "test-coverage": "vendor/bin/phpunit --coverage-html coverage"
}, },
"config": { "config": {
"sort-packages": true "sort-packages": true
+1 -2
View File
@@ -20,9 +20,8 @@
</whitelist> </whitelist>
</filter> </filter>
<logging> <logging>
<log type="tap" target="build/report.tap"/>
<log type="junit" target="build/report.junit.xml"/> <log type="junit" target="build/report.junit.xml"/>
<log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/> <log type="coverage-html" target="build/coverage" />
<log type="coverage-text" target="build/coverage.txt"/> <log type="coverage-text" target="build/coverage.txt"/>
<log type="coverage-clover" target="build/logs/clover.xml"/> <log type="coverage-clover" target="build/logs/clover.xml"/>
</logging> </logging>