Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
kinetix-comments
happones/kinetix
claude-code
comments
threaded-replies
commentable
vue
authorization
composable
i18n

Polymorphic, threaded comments on any model: read/post for viewers, one-level replies, author-only edit/delete, allowlisted commentable types. Activates when adding comments/discussions to a model.

Install
php artisan boost:add-skill happones/kinetix

Save this content to: .claude/skills/kinetix-comments/SKILL.md

# Kinetix Comments Development

## When to Apply

Activate this skill when:
- Adding comments / discussion threads to any model (post, task, invoice, …).
- Mounting `<KinetixComments>` or using `useKinetixComments`.
- Declaring which models accept comments.

## Documentation

For full details, reference `docs/comments.md` (published at https://happones.github.io/kinetix/comments).

## Installation & Configuration

```bash
php artisan vendor:publish --tag=kinetix-comments-migrations
php artisan migrate
```

```php
'comments' => ['enabled' => env('KINETIX_COMMENTS_ENABLED', false)],
```

```php
use Happones\Kinetix\Comments\KinetixComments;

// AppServiceProvider::boot() — allowlist commentable models (class or morph alias)
KinetixComments::for([\App\Models\Post::class, \App\Models\Task::class]);
```

Only allowlisted models can be commented on (unregistered types 404).

---

## Backend

- **`CommentManager`**: `for($commentable, $user)` returns a 1-level threaded
  tree of `CommentData` (`editable` = author is the current user); `create`,
  `update`, `delete` (delete cascades replies).
- **`CommentController`** (self-service, team-aware `{prefix}/comments`):
  `index`/`store` resolve + authorize the commentable via the registry and an
  optional `view` policy; `update`/`destroy {comment}` are restricted to the
  author (403). Replies must target a top-level comment of the same commentable.
- `Comment` model: `morphTo commentable`, `hasMany replies`, `belongsTo author`.

---

## Frontend

```vue
<KinetixComments commentable-type="App\Models\Post" :commentable-id="post.id" />
```

Composer + threaded list (author avatar/initials, relative time, edited badge),
inline reply, and edit/delete on the user's own comments. `useKinetixComments(type, id)`
→ `{ comments, loading, load, post, edit, remove }`. i18n `comment_*` (en/es/fr/pt).

## UUID / ULID Host Models

This feature's migration builds `user_id`, plus the `commentable_id` morph id with
`Happones\Kinetix\Support\HostKeys`, which types each column after YOUR model
at migrate time from its primary key (`HasUlids` -> ulid, `HasUuids` -> uuid, string `$keyType` ->
string, else bigint). Pin `kinetix.key_types.user|team` when detection cannot
see the setup; morph ids follow `kinetix.key_types.morph` (default bigint) —
set it when the referenced models use UUIDs/ULIDs. Apps migrated on an older
Kinetix have bigint columns on disk and need their own ALTER migration. Full
recipe: the `kinetix-boost` skill, section "UUID / ULID Host Models".

Kinetix Comments Development

When to Apply

Activate this skill when:

  • Adding comments / discussion threads to any model (post, task, invoice, …).
  • Mounting <KinetixComments> or using useKinetixComments.
  • Declaring which models accept comments.

Documentation

For full details, reference docs/comments.md (published at https://happones.github.io/kinetix/comments).

Installation & Configuration

php artisan vendor:publish --tag=kinetix-comments-migrations
php artisan migrate
'comments' => ['enabled' => env('KINETIX_COMMENTS_ENABLED', false)],
use Happones\Kinetix\Comments\KinetixComments;

// AppServiceProvider::boot() — allowlist commentable models (class or morph alias)
KinetixComments::for([\App\Models\Post::class, \App\Models\Task::class]);

Only allowlisted models can be commented on (unregistered types 404).


Backend

  • CommentManager: for($commentable, $user) returns a 1-level threaded tree of CommentData (editable = author is the current user); create, update, delete (delete cascades replies).
  • CommentController (self-service, team-aware {prefix}/comments): index/store resolve + authorize the commentable via the registry and an optional view policy; update/destroy {comment} are restricted to the author (403). Replies must target a top-level comment of the same commentable.
  • Comment model: morphTo commentable, hasMany replies, belongsTo author.

Frontend

<KinetixComments commentable-type="App\Models\Post" :commentable-id="post.id" />

Composer + threaded list (author avatar/initials, relative time, edited badge), inline reply, and edit/delete on the user's own comments. useKinetixComments(type, id) → { comments, loading, load, post, edit, remove }. i18n comment_* (en/es/fr/pt).

UUID / ULID Host Models

This feature's migration builds user_id, plus the commentable_id morph id with Happones\Kinetix\Support\HostKeys, which types each column after YOUR model at migrate time from its primary key (HasUlids -> ulid, HasUuids -> uuid, string $keyType -> string, else bigint). Pin kinetix.key_types.user|team when detection cannot see the setup; morph ids follow kinetix.key_types.morph (default bigint) — set it when the referenced models use UUIDs/ULIDs. Apps migrated on an older Kinetix have bigint columns on disk and need their own ALTER migration. Full recipe: the kinetix-boost skill, section "UUID / ULID Host Models".

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource