PHPackages                             xentixar/filament-comments - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. xentixar/filament-comments

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

xentixar/filament-comments
==========================

A powerful recursive comments system for Filament, allowing you to add nested commenting functionality to your Filament resources and custom Livewire pages.

v1.1.0(1y ago)4212MITPHP

Since Apr 1Pushed 1y ago1 watchersCompare

[ Source](https://github.com/xentixar/filament-comments)[ Packagist](https://packagist.org/packages/xentixar/filament-comments)[ Docs](https://github.com/xentixar/filament-comments)[ RSS](/packages/xentixar-filament-comments/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (4)Used By (0)

Filament Comments
=================

[](#filament-comments)

A powerful recursive comments system for Filament, allowing you to add nested commenting functionality to your Filament resources and custom Livewire pages.

 [![Filament Comments Banner](banner.svg)](banner.svg)

 [ ![Packagist](https://camo.githubusercontent.com/c91a9d393379dd2c04b2f2717f356df08df001ffac117bbd61cde97dcce444ca/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f78656e74697861722f66696c616d656e742d636f6d6d656e74732e7376673f7374796c653d666f722d7468652d6261646765) ](https://packagist.org/packages/xentixar/filament-comments) [ ![Packagist](https://camo.githubusercontent.com/7b0f1eb092a705fcf2d7e7712225371372066230ad02dcf44905cd4b5b118d43/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f78656e74697861722f66696c616d656e742d636f6d6d656e74732e7376673f7374796c653d666f722d7468652d6261646765) ](https://packagist.org/packages/xentixar/filament-comments/stats) [ ![Packagist](https://camo.githubusercontent.com/db63f56c41e5f2361e5ba8361bcb68ee433ba67f077324d090b181290749bd99/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f78656e74697861722f66696c616d656e742d636f6d6d656e74732e7376673f7374796c653d666f722d7468652d6261646765) ](#) [ ![Packagist](https://camo.githubusercontent.com/86c4bae1a510aca2411c07f8d7e333eed2c0ce4ed1b2967c66b34cd82fff6aea/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f78656e74697861722f66696c616d656e742d636f6d6d656e74733f7374796c653d666f722d7468652d6261646765) ](https://packagist.org/packages/xentixar/filament-comments) [ ![Packagist](https://camo.githubusercontent.com/12be69c15ea43afba04bcc96589ebec322d4bfb1a8ba6293c195a2550729e4a1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f78656e74697861722f66696c616d656e742d636f6d6d656e74733f7374796c653d666f722d7468652d6261646765) ](https://github.com/xentixar/filament-comments/forks)

Overview
--------

[](#overview)

Filament 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.

### Key Benefits

[](#key-benefits)

- **Versatile Integration**: Works seamlessly in both Filament admin panels and custom Livewire pages
- **Real-time Updates**: Powered by Livewire for instant comment updates without page refreshes
- **Flexible Architecture**: Support for multiple comment types and customizable configurations
- **Activity Tracking**: Monitor comment interactions and user engagement
- **Modern UI**: Clean and intuitive interface that matches Filament's design language
- **Table Support**: Built-in support for Filament tables in both admin and custom pages
- **Smart Pagination**: Elegant "Show More" and "Show Less" pagination for comments and replies

Features
--------

[](#features)

- Easy integration with Filament admin panel
- Recursive (nested) comments support
- Real-time comments using Livewire
- Activity tracking for comments
- Configurable and customizable
- Supports multiple comment types
- Built-in migrations and configurations
- Rich text editor support
- Comment threading and replies
- Incremental pagination with "Show More" and "Show Less" controls
- User mention functionality with notifications

Requirements
------------

[](#requirements)

- PHP 8.1+
- Laravel 10.0+
- Filament 3.0+

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require xentixar/filament-comments
```

Publish the service provider:

```
php artisan vendor:publish --provider="Xentixar\FilamentComment\FilamentCommentServiceProvider"
```

Run the migrations:

```
php artisan migrate
```

Usage
-----

[](#usage)

### Adding Comments to Your Models

[](#adding-comments-to-your-models)

To enable comments on your model, use the `HasFilamentComment` trait and implement `Commentable` contract:

```
use Xentixar\FilamentComment\Models\Traits\HasFilamentComment;
use Xentixar\FilamentComment\Contracts\Commentable;

class Post extends Model implements Commentable
{
    use HasFilamentComment;

    protected $fillable = ['title', 'content', 'user_id'];
}
```

### Using in Filament Admin Panel

[](#using-in-filament-admin-panel)

To add the comment preview functionality to your Filament resource tables:

```
use Xentixar\FilamentComment\Tables\Actions\PreviewCommentAction;

class PostResource extends Resource
{
    public static function table(Table $table): Table
    {
        return $table
            ->columns([
                // Your columns...
            ])
            ->actions([
                Tables\Actions\ViewAction::make(),
                Tables\Actions\EditAction::make(),
                PreviewCommentAction::make()
            ]);
    }
}
```

### Using in Custom Livewire Pages

[](#using-in-custom-livewire-pages)

You can also use the comment system in your custom Livewire pages:

```
use Xentixar\FilamentComment\Tables\Actions\PreviewCommentAction;
use Filament\Tables\Concerns\InteractsWithTable;
use Filament\Tables\Contracts\HasTable;

class CustomPage extends Component implements HasTable
{
    use InteractsWithTable;

    public function table(Table $table): Table
    {
        return $table
            ->columns([
                // Your columns...
            ])
            ->actions([
                PreviewCommentAction::make()
            ]);
    }
}
```

### User Mentions

[](#user-mentions)

The comment system supports user mentions with notifications. Users can be mentioned in comments using the `@username` syntax:

```
// In your comment
@john This is a great idea!
```

When a user is mentioned, they will receive a notification if notifications are enabled in the configuration.

### Adding Username to User Model

[](#adding-username-to-user-model)

To 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.

1. Add both `name` and `username` attributes to your User model if they don't exist:

```
// In your User model
class User extends Authenticatable
{
    protected $fillable = [
        'name',
        'username',
        'email',
        'password',
        // other fields...
    ];
}
```

2. If you're using different attribute names for the user's display name or username, you can customize this in the configuration:

```
// In config/filament-comments.php
return [
    'user_model' => \App\Models\User::class,
    'user_table' => 'users',
    'mention_column' => 'username', // Change this to your custom username attribute
    'display_name_column' => 'name', // Change this to your custom display name attribute
    // other configuration options...
];
```

3. If you need to add migrations to add these fields to your users table:

```
php artisan make:migration add_name_and_username_to_users_table
```

Then in the migration file:

```
public function up()
{
    Schema::table('users', function (Blueprint $table) {
        $table->string('name')->nullable()->after('id');
        $table->string('username')->unique()->after('name');
    });
}

public function down()
{
    Schema::table('users', function (Blueprint $table) {
        $table->dropColumn(['name', 'username']);
    });
}
```

### Configuration

[](#configuration)

You can publish and customize the configuration file:

```
php artisan vendor:publish --provider="Xentixar\FilamentComment\FilamentCommentServiceProvider" --tag="config"
```

This will publish the configuration file to `config/filament-comments.php`. Here you can customize various aspects of the comments system:

```
return [
    'comment_table' => 'comments',
    'comment_activity_table' => 'comment_activities',
    'user_table' => 'users',
    'user_model' => \App\Models\User::class,
    'mention_column' => 'username',
    'send_notifications' => true,
    'mention_notification_title' => 'mentioned in a comment!',
    'display_name_column' => 'name'
];
```

#### Configuration Options

[](#configuration-options)

- **Comment Table**: Customize the table name for storing comments
- **Comment Activity Table**: Customize the table name for storing comment activities
- **User Model**: Specify your application's user model
- **User Table**: Customize the table name for storing users
- **Mention Column**: Specify which attribute to use for user mentions
- **Send Notifications**: Enable or disable notifications for user mentions
- **Mention Notification Title**: Customize the title of mention notifications
- **Display Name Column**: Specify which attribute to use for displaying user and avatar

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

Support
-------

[](#support)

For support, please open an issue in the [GitHub repository](https://github.com/xentixar/filament-comments/issues).

Credits
-------

[](#credits)

- [xentixar](https://github.com/xentixar)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance50

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Total

2

Last Release

396d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/02fcfef53b44a7da91a3d46bfb38adb40f900d8ac85a71788e3bf41fd2237c6f?d=identicon)[xentixar](/maintainers/xentixar)

---

Top Contributors

[![xentixar](https://avatars.githubusercontent.com/u/152050438?v=4)](https://github.com/xentixar "xentixar (33 commits)")

---

Tags

filamentfilamentphpfilamentphp-pluginlaravelphppluginlaravelcommentsfilament

### Embed Badge

![Health badge](/badges/xentixar-filament-comments/health.svg)

```
[![Health](https://phpackages.com/badges/xentixar-filament-comments/health.svg)](https://phpackages.com/packages/xentixar-filament-comments)
```

###  Alternatives

[awcodes/filament-table-repeater

A modified version of the Filament Forms Repeater to display it as a table.

262815.1k5](/packages/awcodes-filament-table-repeater)[pboivin/filament-peek

Full-screen page preview modal for Filament

253319.6k12](/packages/pboivin-filament-peek)[awcodes/filament-badgeable-column

Filament Tables column to append and prepend badges.

142419.3k3](/packages/awcodes-filament-badgeable-column)[awcodes/light-switch

Plugin to add theme switching (light/dark/system) to the auth pages for Filament Panels

4789.9k2](/packages/awcodes-light-switch)[awcodes/recently

Easily track and access recently viewed records in your filament panels.

4224.3k](/packages/awcodes-recently)[awcodes/palette

A color picker field for Filament Forms that uses preset color palettes.

2552.6k5](/packages/awcodes-palette)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
