Skip to content

Conversation

@navneetrai
Copy link
Member

@navneetrai navneetrai commented Sep 17, 2025

Resolves #51

This pull request introduces a comprehensive "readonly" mode for the comments system, primarily targeting Filament 4 integration. The readonly mode prevents users from adding, editing, deleting, or reacting to comments, while still displaying existing comments and reactions. The changes include backend logic, Livewire components, Blade templates, and documentation updates to fully support and document this feature.

Readonly Mode Implementation and Integration:

  • Added new IsReadonly trait to both Filament actions (CommentsAction, CommentsTableAction) and Livewire components (Comments, CommentList, Comment, Reactions), providing a unified way to set and check readonly state. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16]
  • Updated all relevant Blade views to respect the readonly state, disabling form fields, action buttons, and reaction interactivity when enabled. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]
  • Prevented backend actions (save, edit, update, delete, react) from executing in readonly mode, ensuring security and consistency. [1] [2] [3] [4] [5]

Documentation and User Guidance:

  • Expanded the README with detailed instructions for enabling readonly mode in Filament 4 forms, including code samples, use cases, and a dedicated section on testing readonly functionality.

User Experience Improvements:

  • Added a new message to the language files and Filament form section to inform users that a record must be saved before comments are enabled. [1] [2]

Other:

  • Cleaned up phpstan.neon by removing an obsolete ignore rule for PHPUnit method not found errors.

These changes provide a robust, configurable readonly mode for comments, improving support for audit trails, view-only access, and other scenarios where comment modification should be restricted.

@navneetrai navneetrai self-assigned this Sep 17, 2025
@agencetwogether
Copy link
Contributor

Nice to permit to set readonly !!
😊

Is this PR has chance to be merged ?

@navneetrai navneetrai changed the title Add comments section to Filament forms and update README Add Readonly mode for comments section Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to add this to the Edit Form

3 participants