filament-comments
filament-comments copied to clipboard
Support viewing comments as guest / prevent exceptions
This PR makes prevents the plugin from throwing exceptions when no user is logged in due to calling ->can() on null as part of the authz checks.
The PR has no impact on merge because the authz checks default to false. To actually render the comments for guests the developer has to override the ->visible() statement on the place of implementation, for example:
CommentsEntry::make('filament_comments')
->visible(fn (): bool => auth()->user()?->can('viewAny', config('filament-comments.comment_model')) ?? true),