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
+44Lines changed: 44 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -99,6 +99,7 @@ The `ForumUser` trait provides:
99
99
-`getMentionableUsers()` method - Customize which users are mentionable (see "Custom Mentionables" below)
100
100
-`hasCustomForumSearch()`, `getForumSearchResults()`, `getForumOptionLabel()` methods - Custom search functionality (see "Custom User Model, Attribute, and Search Functionality" below)
101
101
-`isForumAdmin()` method - Override to grant admin access to hidden forums (defaults to `false`)
102
+
-`canCreateForum()` method - Controls forum creation permissions (see "Forum Creation Permissions" below)
102
103
103
104
6. Add to your custom theme (usually`theme.css`) file:
104
105
@@ -370,6 +371,49 @@ public static function getMentionableUsers()
370
371
371
372
Forums can be set as public (visible to all logged-in users) or hidden (only visible to assigned users). Forum admins can see all hidden forums regardless of assignment.
372
373
374
+
### Forum Creation Permissions
375
+
376
+
By default, forum creation is **disabled** for security. To enable forum creation, you must add the `ForumUser` trait to your User model and override the `canCreateForum()` method:
377
+
378
+
```php
379
+
// In your User model
380
+
use Tapp\FilamentForum\Traits\ForumUser;
381
+
382
+
class User extends Authenticatable
383
+
{
384
+
use ForumUser;
385
+
386
+
/**
387
+
* Determine if the user can create forums.
388
+
* Override this method to enable forum creation with custom logic.
0 commit comments