mirror of
https://github.com/wearepixel/laravel-comments.git
synced 2026-11-14 22:12:35 +00:00
Updated Readme
This commit is contained in:
@@ -148,30 +148,12 @@ $comment->commentAsUser($user, "Hey there!");
|
|||||||
|
|
||||||
#### Deleting Replies
|
#### Deleting Replies
|
||||||
|
|
||||||
When you delete a comment, you may optionally want to delete all it's nested comments (replies). To do optionally enable this feature, set the `delete_replies_along_comments` config property in the `configs/comments.php` file to `true`.
|
When you delete a comment, you may optionally want to delete all its nested comments (replies). To optionally enable this feature, set the `delete_replies_along_comments` config property in the `config/comments.php` file to `true`.
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
|
||||||
When a new comment is added the `BeyondCode\Comments\Events\CommentAdded` event will be dispatched.
|
When a new comment is added the `BeyondCode\Comments\Events\CommentAdded` event will be dispatched.
|
||||||
When a comment is deleted the `BeyondCode\Comments\Events\CommentDeleted` event will be dispatched.
|
When a comment is deleted the `BeyondCode\Comments\Events\CommentDeleted` event will be dispatched.
|
||||||
you can listen to these event and do other things as your requirements call for.
|
|
||||||
|
|
||||||
_App\Providers\EventServiceProvider_
|
|
||||||
|
|
||||||
```php
|
|
||||||
use BeyondCode\Comments\Events\CommentAdded;
|
|
||||||
use BeyondCode\Comments\Events\CommentDeleted;
|
|
||||||
use App\Listeners\InformAdmin;
|
|
||||||
|
|
||||||
protected $listen = [
|
|
||||||
CommentAdded::class => [
|
|
||||||
InformAdmin::class,
|
|
||||||
],
|
|
||||||
CommentDeleted::class => [
|
|
||||||
InformAdmin::class,
|
|
||||||
],
|
|
||||||
];
|
|
||||||
```
|
|
||||||
|
|
||||||
### Testing
|
### Testing
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -35,7 +35,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "XDEBUG_MODE=coverage 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": {
|
||||||
|
|||||||
Reference in New Issue
Block a user