{"id":26917471,"url":"https://github.com/xentixar/filament-comments","last_synced_at":"2025-09-11T01:09:11.174Z","repository":{"id":285411265,"uuid":"957902850","full_name":"xentixar/filament-comments","owner":"xentixar","description":"A powerful comments system for Filament admin panel, allowing you to add commenting functionality to your Filament resources.","archived":false,"fork":false,"pushed_at":"2025-04-07T20:45:16.000Z","size":91,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-20T03:24:12.099Z","etag":null,"topics":["filament","filamentphp","filamentphp-plugin","laravel","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xentixar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-31T10:32:16.000Z","updated_at":"2025-07-06T17:31:32.000Z","dependencies_parsed_at":"2025-04-07T17:27:46.053Z","dependency_job_id":null,"html_url":"https://github.com/xentixar/filament-comments","commit_stats":null,"previous_names":["xentixar/filament-comments"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/xentixar/filament-comments","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xentixar%2Ffilament-comments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xentixar%2Ffilament-comments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xentixar%2Ffilament-comments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xentixar%2Ffilament-comments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xentixar","download_url":"https://codeload.github.com/xentixar/filament-comments/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xentixar%2Ffilament-comments/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274557583,"owners_count":25307516,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-10T02:00:12.551Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["filament","filamentphp","filamentphp-plugin","laravel","php"],"created_at":"2025-04-01T20:36:57.317Z","updated_at":"2025-09-11T01:09:11.139Z","avatar_url":"https://github.com/xentixar.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Filament Comments\nA powerful recursive comments system for Filament, allowing you to add nested commenting functionality to your Filament resources and custom Livewire pages.\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"banner.svg\" alt=\"Filament Comments Banner\" width=\"100%\"\u003e\n\u003c/div\u003e\n\u003cp class=\"flex items-center justify-center\"\u003e\n    \u003ca href=\"https://packagist.org/packages/xentixar/filament-comments\"\u003e\n        \u003cimg alt=\"Packagist\" src=\"https://img.shields.io/packagist/v/xentixar/filament-comments.svg?style=for-the-badge\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://packagist.org/packages/xentixar/filament-comments/stats\"\u003e\n        \u003cimg alt=\"Packagist\" src=\"https://img.shields.io/packagist/dt/xentixar/filament-comments.svg?style=for-the-badge\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"#\"\u003e\n        \u003cimg alt=\"Packagist\" src=\"https://img.shields.io/packagist/l/xentixar/filament-comments.svg?style=for-the-badge\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://packagist.org/packages/xentixar/filament-comments\"\u003e\n        \u003cimg alt=\"Packagist\" src=\"https://img.shields.io/github/stars/xentixar/filament-comments?style=for-the-badge\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/xentixar/filament-comments/forks\"\u003e\n        \u003cimg alt=\"Packagist\" src=\"https://img.shields.io/github/forks/xentixar/filament-comments?style=for-the-badge\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n## Overview\n\nFilament Comments is a robust and feature-rich commenting system designed for both Filament admin panels and custom Livewire pages. It provides a seamless way to implement nested comments, discussions, and feedback mechanisms across your application.\n\n### Key Benefits\n\n- **Versatile Integration**: Works seamlessly in both Filament admin panels and custom Livewire pages\n- **Real-time Updates**: Powered by Livewire for instant comment updates without page refreshes\n- **Flexible Architecture**: Support for multiple comment types and customizable configurations\n- **Activity Tracking**: Monitor comment interactions and user engagement\n- **Modern UI**: Clean and intuitive interface that matches Filament's design language\n- **Table Support**: Built-in support for Filament tables in both admin and custom pages\n- **Smart Pagination**: Elegant \"Show More\" and \"Show Less\" pagination for comments and replies\n\n## Features\n\n- Easy integration with Filament admin panel\n- Recursive (nested) comments support\n- Real-time comments using Livewire\n- Activity tracking for comments\n- Configurable and customizable\n- Supports multiple comment types\n- Built-in migrations and configurations\n- Rich text editor support\n- Comment threading and replies\n- Incremental pagination with \"Show More\" and \"Show Less\" controls\n- User mention functionality with notifications\n\n## Requirements\n\n- PHP 8.1+\n- Laravel 10.0+\n- Filament 3.0+\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require xentixar/filament-comments\n```\n\nPublish the service provider:\n\n```bash\nphp artisan vendor:publish --provider=\"Xentixar\\FilamentComment\\FilamentCommentServiceProvider\"\n```\n\nRun the migrations:\n```bash\nphp artisan migrate\n```\n\n## Usage\n\n### Adding Comments to Your Models\n\nTo enable comments on your model, use the `HasFilamentComment` trait and implement `Commentable` contract:\n\n```php\nuse Xentixar\\FilamentComment\\Models\\Traits\\HasFilamentComment;\nuse Xentixar\\FilamentComment\\Contracts\\Commentable;\n\nclass Post extends Model implements Commentable\n{\n    use HasFilamentComment;\n    \n    protected $fillable = ['title', 'content', 'user_id'];\n}\n```\n\n### Using in Filament Admin Panel\n\nTo add the comment preview functionality to your Filament resource tables:\n\n```php\nuse Xentixar\\FilamentComment\\Tables\\Actions\\PreviewCommentAction;\n\nclass PostResource extends Resource\n{\n    public static function table(Table $table): Table\n    {\n        return $table\n            -\u003ecolumns([\n                // Your columns...\n            ])\n            -\u003eactions([\n                Tables\\Actions\\ViewAction::make(),\n                Tables\\Actions\\EditAction::make(),\n                PreviewCommentAction::make()\n            ]);\n    }\n}\n```\n\n### Using in Custom Livewire Pages\n\nYou can also use the comment system in your custom Livewire pages:\n\n```php\nuse Xentixar\\FilamentComment\\Tables\\Actions\\PreviewCommentAction;\nuse Filament\\Tables\\Concerns\\InteractsWithTable;\nuse Filament\\Tables\\Contracts\\HasTable;\n\nclass CustomPage extends Component implements HasTable\n{\n    use InteractsWithTable;\n\n    public function table(Table $table): Table\n    {\n        return $table\n            -\u003ecolumns([\n                // Your columns...\n            ])\n            -\u003eactions([\n                PreviewCommentAction::make()\n            ]);\n    }\n}\n```\n\n\n### User Mentions\n\nThe comment system supports user mentions with notifications. Users can be mentioned in comments using the `@username` syntax:\n\n```php\n// In your comment\n@john This is a great idea!\n```\n\nWhen a user is mentioned, they will receive a notification if notifications are enabled in the configuration.\n\n### Adding Username to User Model\n\nTo ensure proper display of usernames in comments, you need to make sure your User model has both `name` and `username` attributes. The `name` attribute is used for display purposes, while the `username` attribute is used for mentions.\n\n1. Add both `name` and `username` attributes to your User model if they don't exist:\n\n```php\n// In your User model\nclass User extends Authenticatable\n{\n    protected $fillable = [\n        'name',\n        'username',\n        'email',\n        'password',\n        // other fields...\n    ];\n}\n```\n\n2. If you're using different attribute names for the user's display name or username, you can customize this in the configuration:\n\n```php\n// In config/filament-comments.php\nreturn [\n    'user_model' =\u003e \\App\\Models\\User::class,\n    'user_table' =\u003e 'users',\n    'mention_column' =\u003e 'username', // Change this to your custom username attribute\n    'display_name_column' =\u003e 'name', // Change this to your custom display name attribute\n    // other configuration options...\n];\n```\n\n3. If you need to add migrations to add these fields to your users table:\n\n```bash\nphp artisan make:migration add_name_and_username_to_users_table\n```\n\nThen in the migration file:\n\n```php\npublic function up()\n{\n    Schema::table('users', function (Blueprint $table) {\n        $table-\u003estring('name')-\u003enullable()-\u003eafter('id');\n        $table-\u003estring('username')-\u003eunique()-\u003eafter('name');\n    });\n}\n\npublic function down()\n{\n    Schema::table('users', function (Blueprint $table) {\n        $table-\u003edropColumn(['name', 'username']);\n    });\n}\n```\n\n### Configuration\n\nYou can publish and customize the configuration file:\n\n```bash\nphp artisan vendor:publish --provider=\"Xentixar\\FilamentComment\\FilamentCommentServiceProvider\" --tag=\"config\"\n```\n\nThis will publish the configuration file to `config/filament-comments.php`. Here you can customize various aspects of the comments system:\n\n```php\nreturn [\n    'comment_table' =\u003e 'comments',\n    'comment_activity_table' =\u003e 'comment_activities',\n    'user_table' =\u003e 'users',\n    'user_model' =\u003e \\App\\Models\\User::class,\n    'mention_column' =\u003e 'username',\n    'send_notifications' =\u003e true,\n    'mention_notification_title' =\u003e 'mentioned in a comment!',\n    'display_name_column' =\u003e 'name'\n];\n```\n\n#### Configuration Options\n\n- **Comment Table**: Customize the table name for storing comments\n- **Comment Activity Table**: Customize the table name for storing comment activities\n- **User Model**: Specify your application's user model\n- **User Table**: Customize the table name for storing users\n- **Mention Column**: Specify which attribute to use for user mentions\n- **Send Notifications**: Enable or disable notifications for user mentions\n- **Mention Notification Title**: Customize the title of mention notifications\n- **Display Name Column**: Specify which attribute to use for displaying user and avatar\n\n## Contributing\n\nPlease see [CONTRIBUTING.md](CONTRIBUTING.md) for details.\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE) for more information.\n\n## Support\n\nFor support, please open an issue in the [GitHub repository](https://github.com/xentixar/filament-comments/issues).\n\n## Credits\n\n- [xentixar](https://github.com/xentixar)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxentixar%2Ffilament-comments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxentixar%2Ffilament-comments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxentixar%2Ffilament-comments/lists"}