Skip to content

Commit a843c23

Browse files
authored
Documentation: Update Mentions Screenshot
- Added a mentions screenshot - Added code for configuring mentions in config
1 parent 5a01e3b commit a843c23

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,26 @@ $record = Conference::find(1); // Get your record from the database then,
213213
The package uses Filament TipTap Editor which supports mentions. You can mention users in your comments by typing `@` followed by the user's name. The package will automatically resolve the user and send them a notification.
214214
You can customize how to fetch mentions by changing the `.closures.getMentionsUsing` closure in the config file. Two sample methods have been included in the main class for getting all users in the DB or only users that have been mentioned in the current thread (default). Customize this however you wish.
215215

216+
**Get only users mentioned in the current thread:**
217+
218+
```php
219+
[
220+
'getMentionsUsing' => fn (
221+
string $query,
222+
Model $commentable
223+
) => app(\Coolsam\NestedComments\NestedComments::class)->getCurrentThreadUsers($query, $commentable),
224+
]
225+
```
226+
227+
**Get all users from your database**
228+
229+
```php
230+
[
231+
'getMentionsUsing' => 'getMentionsUsing' => fn (string $query, Model $commentable) => app(\Coolsam\NestedComments\NestedComments::class)->getUserMentions($query),
232+
]
233+
```
234+
![image](https://github.com/user-attachments/assets/bd7a395a-fc32-4057-b6bc-24763132f555)
235+
216236

217237
## Usage: Emoji Reactions
218238
This package also allows you to add emoji reactions to your models. You can use the `HasReactions` trait to add reactions to any model. The reactions are stored in a separate table, and you can customize the reactions that are available via the configuration file.
@@ -302,7 +322,8 @@ In your view:
302322
<livewire:nested-comments::reaction-panel :record="$record"/>
303323
```
304324
The two components can be used anywhere, in resource pages, custom pages, actions, form fields, widgets, livewire components or just plain blade views. Here is a sample screenshot of how the components will be rendered:
305-
![image](https://github.com/user-attachments/assets/4926c3c6-e679-4713-a6e6-c4f17da4f85a)
325+
![image](https://github.com/user-attachments/assets/0162f294-0477-454c-ae5c-67424edc207f)
326+
306327

307328
## Package Customization
308329
You can customize the package by changing most of the default values in the config file after publishing it.

0 commit comments

Comments
 (0)