You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-7Lines changed: 21 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,8 @@
10
10
11
11
This package allows you to incorporate comments and replies in your Filament forms, infolists, pages, widgets etc, or even simply in your livewire components. Comment replies can be nested as deep as you want, using the Nested Set data structure. Additionally, the package comes with a Reactions feature to enable your users to react to any of your models (e.g comments or posts) with selected emoji reactions.
@@ -31,14 +32,14 @@ Adjust the configuration file as necessary, then run migrations.
31
32
32
33
`That's it! You are now ready to add nested comments
33
34
34
-
## Usage
35
+
## Usage: Comments
35
36
At the very basic level, this package is simply a Livewire Component that takes in a model record which is commentable. Follow the following steps to prepare your model to be commentable or reactable:
36
37
1. Add the `HasComments` trait to your model
37
38
```php
38
39
39
40
use Coolsam\NestedComments\Traits\HasComments;
40
41
41
-
class Post extends Model
42
+
class Conference extends Model
42
43
{
43
44
use HasComments;
44
45
@@ -50,14 +51,14 @@ class Post extends Model
50
51
```php
51
52
use Coolsam\NestedComments\Traits\HasReactions;
52
53
53
-
class Post extends Model
54
+
class Conference extends Model
54
55
{
55
56
use HasReactions;
56
57
57
58
// ...
58
59
}
59
60
```
60
-
3. You can now access the comments and reactions of your model using the following methods:
61
+
3. You can now access the comments and reactions of your model in the following ways
61
62
62
63
### Using the Comments Infolist Entry
63
64
@@ -76,13 +77,19 @@ public static function infolist(Infolist $infolist): Infolist
This unlocks incredible possibilities. It allows you to render your comments even in your own frontend blade page. All you have to do is simply pass the commentable `$record` to the blade component
0 commit comments