{"id":28472052,"url":"https://github.com/parallax/filament-comments","last_synced_at":"2025-07-01T22:30:39.458Z","repository":{"id":219943029,"uuid":"749174505","full_name":"parallax/filament-comments","owner":"parallax","description":"Add comments to your Filament Resources","archived":false,"fork":false,"pushed_at":"2025-03-27T12:13:46.000Z","size":2779,"stargazers_count":117,"open_issues_count":21,"forks_count":53,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-06-22T00:55:34.808Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://filamentphp.com/plugins/parallax-comments","language":"PHP","has_issues":false,"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/parallax.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2024-01-27T19:40:40.000Z","updated_at":"2025-05-14T15:40:33.000Z","dependencies_parsed_at":"2024-02-06T10:42:30.796Z","dependency_job_id":"bb7fd588-2338-488f-95bc-9ac004679f79","html_url":"https://github.com/parallax/filament-comments","commit_stats":null,"previous_names":["parallax/filament-comments"],"tags_count":8,"template":false,"template_full_name":"filamentphp/plugin-skeleton","purl":"pkg:github/parallax/filament-comments","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parallax%2Ffilament-comments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parallax%2Ffilament-comments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parallax%2Ffilament-comments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parallax%2Ffilament-comments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parallax","download_url":"https://codeload.github.com/parallax/filament-comments/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parallax%2Ffilament-comments/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261217768,"owners_count":23126270,"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","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":[],"created_at":"2025-06-07T11:09:47.717Z","updated_at":"2025-07-01T22:30:39.406Z","avatar_url":"https://github.com/parallax.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Filament Comments\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/parallax/filament-comments?style=flat-square)](https://packagist.org/packages/parallax/filament-comments)\n[![Software License](https://img.shields.io/packagist/l/parallax/filament-comments?style=flat-square)](LICENSE.md)\n[![Total Downloads](https://img.shields.io/packagist/dt/parallax/filament-comments?style=flat-square)](https://packagist.org/packages/parallax/filament-comments)\n![Stars](https://img.shields.io/github/stars/parallax/filament-comments?style=flat-square)\n\nAdd comments to your Filament Resources.\n\n\u003cimg class=\"filament-hidden\" src=\"https://github.com/parallax/filament-comments/raw/main/assets/filament-comments.jpg\"/\u003e\n\n## Installation\n\nInstall the package via composer:\n\n```bash\ncomposer require parallax/filament-comments\n```\n\nPublish and run the migrations:\n\n```bash\nphp artisan vendor:publish --tag=\"filament-comments-migrations\"\nphp artisan migrate\n```\n\nYou can publish the config file with:\n\n```bash\nphp artisan vendor:publish --tag=\"filament-comments-config\"\n```\n\nYou can publish the language files with:\n\n```bash\nphp artisan vendor:publish --tag=\"filament-comments-translations\"\n```\n\nOptionally, you can publish the views using\n\n```bash\nphp artisan vendor:publish --tag=\"filament-comments-views\"\n```\n\n## Quickstart\n\n### 1. Add model trait\n\nFirst open the eloquent model you wish to add Filament Comments to.\n\n```php\nnamespace App\\Models;\n\nuse Parallax\\FilamentComments\\Models\\Traits\\HasFilamentComments;\n\nclass Product extends Model\n{\n    use HasFilamentComments;\n}\n```\n\n### 2. Add comments to Filament Resource\n\nThere are 3 ways of using this plugin in your Filament Resources:\n\n#### 1. Page actions\n\nOpen the page where you want the comments action to appear, this will most likely be the `ViewResource` page.\n\nAdd the `CommentsAction` to the `getHeaderActions()` method.\n\n```php\n\u003c?php\n\nnamespace App\\Filament\\Resources\\ProductResource\\Pages;\n\nuse Parallax\\FilamentComments\\Actions\\CommentsAction;\n\nclass ViewProduct extends ViewRecord\n{\n    protected function getHeaderActions(): array\n    {\n        return [\n            CommentsAction::make(),\n        ];\n    }\n}\n```\n\nYou may customise the page action as you would any other action.\n\n#### 2. Table actions\n\nOpen the resource where you want the comments table action to appear.\n\nAdd the `CommentsAction` to the `$table-\u003eactions()` method.\n\n```php\n\u003c?php\n\nnamespace App\\Filament\\Resources;\n\nuse Parallax\\FilamentComments\\Tables\\Actions\\CommentsAction;\n\nclass ProductResource extends Resource\n{\n    public static function table(Table $table): Table\n    {\n        return $table\n            -\u003eactions([\n                CommentsAction::make(),\n            ]);\n    }\n}\n```\n\nYou may customise the table action as you would any other action.\n\n#### 3. Infolist entry\n\nIt's also possible to use the comments component within your infolist.\n\nAdd the `CommentsEntry` to the `$infolist-\u003eschema()` method.\n\n```php\n\u003c?php\n\nnamespace App\\Filament\\Resources;\n\nuse Parallax\\FilamentComments\\Infolists\\Components\\CommentsEntry;\n\nclass ProductResource extends Resource\n{\n    public static function infolist(Infolist $infolist): Infolist\n    {\n        return $infolist\n            -\u003eschema([\n                CommentsEntry::make('filament_comments'),\n            ]);\n    }\n}\n```\n\nPlease note that this cannot be used in combination with a comments action on the same page.\n\n## Authorisation\n\nBy default, all users can view \u0026 create comments as well as only delete their own comments.\n\nIf you would like to change this behaviour you can create your own eloquent model policy for the `Parallax\\FilamentComments\\Models\\FilamentComment` model.\n\nYou should define the policy class in the `filament-comments` config file.\n\n```php\nreturn [\n    'model_policy' =\u003e \\Parallax\\FilamentComments\\Policies\\FilamentCommentPolicy::class,\n];\n```\n\n## Pruning deleted comments\n\nComment records are set to be pruned after 30 days of being soft-deleted by default. You may change this value in the config file:\n\n```php\nreturn [\n    'prune_after_days' =\u003e 30,\n];\n```\n\nAfter configuring the model, you should schedule the `model:prune` Artisan command in your application's `Kernel` class. Don't forget to explicitly mention the `FilamentComment` class. You are free to choose the appropriate interval at which this command should be run:\n\n```php\nnamespace App\\Console;\n\nuse Illuminate\\Foundation\\Console\\Kernel as ConsoleKernel;\nuse Parallax\\FilamentComments\\Models\\FilamentComment;\n\nclass Kernel extends ConsoleKernel\n{\n    protected function schedule(Schedule $schedule)\n    {\n        $schedule-\u003ecommand('model:prune', [\n            '--model' =\u003e [FilamentComment::class],\n        ])-\u003edaily();\n    \n        // This will not work, as models in a package are not used by default\n        // $schedule-\u003ecommand('model:prune')-\u003edaily();\n    }\n}\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Credits\n\n- [Parallax](https://parall.ax)\n- [Contributors](https://github.com/parallax/filament-comments/graphs/contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparallax%2Ffilament-comments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparallax%2Ffilament-comments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparallax%2Ffilament-comments/lists"}