Skip to content

Commit fe9917b

Browse files
authored
Documentation: Added Screenshots
- Added Documentation Screenshots
1 parent 67b6c84 commit fe9917b

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

README.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
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.
1212

13-
![image](https://github.com/user-attachments/assets/e4ff32b3-0eb9-4ad4-8edb-de91b1940e13)
13+
![image](https://github.com/user-attachments/assets/d23ef3bc-8621-4616-9ba9-2c695cea049a)
14+
1415

1516

1617
## Installation
@@ -31,14 +32,14 @@ Adjust the configuration file as necessary, then run migrations.
3132

3233
`That's it! You are now ready to add nested comments
3334

34-
## Usage
35+
## Usage: Comments
3536
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:
3637
1. Add the `HasComments` trait to your model
3738
```php
3839

3940
use Coolsam\NestedComments\Traits\HasComments;
4041

41-
class Post extends Model
42+
class Conference extends Model
4243
{
4344
use HasComments;
4445

@@ -50,14 +51,14 @@ class Post extends Model
5051
```php
5152
use Coolsam\NestedComments\Traits\HasReactions;
5253

53-
class Post extends Model
54+
class Conference extends Model
5455
{
5556
use HasReactions;
5657

5758
// ...
5859
}
5960
```
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
6162

6263
### Using the Comments Infolist Entry
6364

@@ -76,13 +77,19 @@ public static function infolist(Infolist $infolist): Infolist
7677
TextEntry::make('created_at')
7778
->dateTime(),
7879
]),
79-
80+
81+
// Add the comments entry
8082
\Coolsam\NestedComments\Filament\Infolists\CommentsEntry::make('comments'),
8183
]);
8284
}
8385
```
86+
![image](https://github.com/user-attachments/assets/da84b49e-66c7-4453-b5d4-b7b18f204bba)
87+
88+
8489

85-
### Using the Comments Widget inside a Resource Page (e.g EditRecord) which has the $record property
90+
### Using the Comments Widget inside a Resource Page (e.g EditRecord)
91+
92+
As long as the resource page interacts with the record, the CommentsWidget will resolve the record automatically.
8693

8794
```php
8895
class EditConference extends EditRecord
@@ -105,6 +112,7 @@ class EditConference extends EditRecord
105112
}
106113
}
107114
```
115+
![image](https://github.com/user-attachments/assets/bd56d52d-b791-4f24-a202-b0948574d811)
108116

109117
### Using the Comments Widget in a custom Filament Page (You have to pass $record manually)
110118

@@ -149,6 +157,10 @@ class ViewConference extends ViewRecord
149157
}
150158
}
151159
```
160+
![image](https://github.com/user-attachments/assets/678d3f1e-b3f9-4a77-b263-af5538c72e2b)
161+
162+
![image](https://github.com/user-attachments/assets/372c6390-ea4e-4d19-8943-784506126cc1)
163+
152164
### Using the Comments Page Action in a custom Filament Page (You have to pass $record manually)
153165
In this case you will have to pass the record attribute manually.
154166

@@ -183,6 +195,8 @@ public static function table(Table $table): Table
183195
]);
184196
}
185197
```
198+
![image](https://github.com/user-attachments/assets/27eead51-c237-4865-b185-3245629cabe4)
199+
186200
### Using the Comments Blade Component ANYWHERE!
187201
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
188202
```php

0 commit comments

Comments
 (0)