PHPackages                             gurento/kafka-consumer-filament - 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. [Admin Panels](/categories/admin)
4. /
5. gurento/kafka-consumer-filament

ActiveLibrary[Admin Panels](/categories/admin)

gurento/kafka-consumer-filament
===============================

Filament UI package for gurento/kafka-consumer.

v1.0.1(3mo ago)556MITPHPPHP ^8.2

Since Apr 22Pushed 1w agoCompare

[ Source](https://github.com/fglend/kafka-consumer-filament)[ Packagist](https://packagist.org/packages/gurento/kafka-consumer-filament)[ RSS](/packages/gurento-kafka-consumer-filament/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

Kafka Consumer Filament
=======================

[](#kafka-consumer-filament)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9e992db49a5636b799491d01cb02b3cd212a43e2b00b9e6354eed4c1d4157d33/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f677572656e746f2f6b61666b612d636f6e73756d65722d66696c616d656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gurento/kafka-consumer-filament)[![Total Downloads](https://camo.githubusercontent.com/ef72c329061938902e9b8cba8d8d819934d78ee3dee0ea064f727f932459d84a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f677572656e746f2f6b61666b612d636f6e73756d65722d66696c616d656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gurento/kafka-consumer-filament)[![License](https://camo.githubusercontent.com/944f3450f177812a35ac5fea06852a9304d0f1a4e1058c175a17ada2969ccaa9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f677572656e746f2f6b61666b612d636f6e73756d65722d66696c616d656e743f7374796c653d666c61742d737175617265)](LICENSE)[![Plumb score](https://camo.githubusercontent.com/4a0966dd4a106b06c9dcad0c0c2f1570ab96cf983eeb12bcce34c5ae8875da80/68747470733a2f2f706c756d627068702e6465762f6261646765732f677572656e746f2f6b61666b612d636f6e73756d65722d66696c616d656e742f636f6d706f736974652e737667)](https://plumbphp.dev/gurento/kafka-consumer-filament)

A [Filament](https://filamentphp.com) admin panel for [`gurento/kafka-consumer`](https://packagist.org/packages/gurento/kafka-consumer) — manage Kafka topic mappings, monitor consumer health, and replay failed messages without leaving your admin panel.

Features
--------

[](#features)

- **Topic management** — full CRUD for topic-to-model mappings, field maps, and relation syncs
- **Live monitoring** — auto-polling table with consumed/failed counters, failure rate, heartbeat, lag, and health badges
- **Consume logs** — per-message log viewer with payload inspection, Kafka partition/offset/key metadata, and status filters
- **One-click operations** — re-consume failed messages, mark topics healthy, and reset counters from the UI
- **Fully customizable** — navigation label, icon, group, badge, slug, labels, and polling are all configurable via a fluent plugin API

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

[](#requirements)

DependencyVersionPHP8.2+Laravel11 / 12 / 13Filament4.x / 5.xgurento/kafka-consumer^1.0Installation
------------

[](#installation)

### 1. Install the packages

[](#1-install-the-packages)

This plugin is the UI layer for [`gurento/kafka-consumer`](https://packagist.org/packages/gurento/kafka-consumer), which does the actual consuming. Install both:

```
composer require gurento/kafka-consumer gurento/kafka-consumer-filament
```

### 2. Set up `gurento/kafka-consumer`

[](#2-set-up-gurentokafka-consumer)

Publish the config and migrations, then migrate:

```
php artisan vendor:publish --tag=kafka-consumer-config
php artisan vendor:publish --tag=kafka-consumer-migrations
php artisan migrate
```

This creates two tables:

- `kafka_topics` — topic-to-model mappings, counters, and health metadata (what this plugin manages)
- `kafka_consume_logs` — per-message processing logs (what the logs viewer reads)

Review `config/kafka-consumer.php` for defaults (consumer group, retry attempts, backoff, health thresholds). The consumer itself ships with a plug-and-play engine based on `mateusjunges/laravel-kafka` — make sure the `rdkafka` PHP extension is installed and your broker settings are configured in the host app's `config/kafka.php`.

Add your Kafka connection settings to `.env`:

```
KAFKA_BROKERS=localhost:9092
KAFKA_CONSUMER_GROUP_ID=app-consumer
KAFKA_DEBUG=false
```

- `KAFKA_BROKERS` — comma-separated broker list (host:port)
- `KAFKA_CONSUMER_GROUP_ID` — default consumer group used when `--group` is not passed
- `KAFKA_DEBUG` — set to `true` to enable verbose librdkafka debug output while troubleshooting

### 3. Register the plugin

[](#3-register-the-plugin)

In your Filament panel provider:

```
use Gurento\KafkaConsumerFilament\Filament\Plugins\KafkaConsumerPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            KafkaConsumerPlugin::make(),
        ]);
}
```

That's it — a **Kafka Topics** resource appears in your panel's navigation.

### 4. Start consuming

[](#4-start-consuming)

Create a topic mapping in the UI, then run the consumer (as a daemon under Supervisor/systemd in production):

```
php artisan gurento:kafka-consume
```

See the [`gurento/kafka-consumer` README](https://github.com/gurento/kafka-consumer#readme) for command options (`--topics`, `--group`, `--from-beginning`, `--stop-on-empty`, `--reconsume-failed`), replay patterns, events, and custom engines.

Customization
-------------

[](#customization)

Every presentation element is dynamic. Configure it fluently on the plugin — each setter accepts a plain value or a `Closure`:

```
KafkaConsumerPlugin::make()
    ->navigationLabel('Event Streams')            // sidebar title
    ->navigationIcon('heroicon-o-queue-list')     // hero icon (string or BackedEnum)
    ->navigationGroup('Integrations')
    ->navigationSort(5)
    ->navigationBadge()                           // badge showing pending retries
    ->modelLabel('Stream')
    ->pluralModelLabel('Streams')
    ->slug('event-streams')                       // URL: /admin/event-streams
    ->tablePollInterval('30s')                    // null disables auto-refresh
    ->modelOptions(fn (): array => [              // restrict target-model dropdown
        \App\Models\Office::class => 'Office',
        \App\Models\Employee::class => 'Employee',
    ]),
```

### Available options

[](#available-options)

MethodTypeDefaultDescription`navigationLabel()``string|Closure``Kafka Topics`Sidebar navigation title`navigationIcon()``string|BackedEnum|Closure``heroicon-o-arrow-down-on-square`Navigation icon`navigationGroup()``string|UnitEnum|Closure``System`Navigation group`navigationSort()``int|Closure`Filament defaultSort order within the group`navigationBadge()``bool|Closure``false`Show pending-retry count as a badge`modelLabel()` / `pluralModelLabel()``string|Closure``kafka topic(s)`Record labels used across pages`slug()``string|Closure``kafka-topics`Resource URL slug`tablePollInterval()``string|null|Closure``10s`Table auto-refresh interval; `null` disables`modelOptions()``array|Closure``app/Models` scanOptions for the target-model dropdownAll options are optional — `KafkaConsumerPlugin::make()` alone keeps the defaults above.

Creating a Topic Mapping
------------------------

[](#creating-a-topic-mapping)

The create/edit form covers everything a topic needs to go from raw Kafka payload to an upserted Eloquent record — no code required.

### Topic Configuration

[](#topic-configuration)

FieldDescription**Kafka Topic**The topic name to consume (e.g. `HR_APP.LIVE.office`), unique per row**Target Model**Eloquent model to upsert into — searchable dropdown scanned from `app/Models` (override via `modelOptions()`)**Upsert Key**Model column used as the unique key for `updateOrCreate` (default `id`)**Exclude Payload Keys**Top-level payload keys to strip before mapping (e.g. `old_values`, `meta`)**Active**Toggle whether the consumer processes this topic**Retry settings**Max re-consume attempts, retry backoff (seconds), and health stale threshold — per topic, falling back to config when unset### Field Mapping (payload matching)

[](#field-mapping-payload-matching)

A repeater that maps payload fields to model columns — each row is one `from → to` pair:

Payload Field (`from`)Model Column (`to`)`uuid``id``name``name`Given `{"uuid": "off-001", "name": "Accounting Office"}`, the consumer writes `id = off-001`, `name = Accounting Office` and upserts by the configured upsert key. Unmapped fields are skipped, so mappings stay explicit and reviewable. Rows collapse to a readable `uuid → id` label.

### Relation Syncs (relationships)

[](#relation-syncs-relationships)

A repeater for syncing `BelongsToMany` relationships from nested arrays in the payload:

FieldDescription**Payload Key**The nested array in the payload (e.g. `office_controller`)**Model Relationship**The relationship method on the target model**Related Model**The related Eloquent model (searchable dropdown)**Lookup Key**Field inside each payload item used to find the related record — auto-detects `uuid` then `id` when blank**Related Model Key**Column on the related model to match against — defaults to its primary keyExample: with payload key `office_controller` and payload

```
{
  "uuid": "off-001",
  "office_controller": [{ "uuid": "emp-001" }, { "uuid": "emp-002" }]
}
```

the consumer looks up each employee by `uuid` and calls `$office->office_controller()->sync([...])`. Items whose related record doesn't exist yet are skipped.

Typical Workflow
----------------

[](#typical-workflow)

1. Open **Kafka Topics** in your panel.
2. Create a topic mapping: topic name, target model, upsert key, field mappings, optional relation syncs.
3. Run the consumer:

    ```
    php artisan gurento:kafka-consume
    ```
4. Monitor counters, health, and logs in the resource (the table auto-refreshes).
5. Re-consume failed messages from the row action or the logs relation manager when needed.

What It Registers
-----------------

[](#what-it-registers)

- `KafkaTopicResource` — list, create, view, and edit pages
- `LogsRelationManager` — read-only consume-log browser with payload inspection and per-log retry
- Row actions: **Re-consume Failed**, **Mark Healthy**, **Reset Counters**

Security &amp; Access
---------------------

[](#security--access)

This package ships UI classes only — it does not impose authorization. Define policies/permissions in your host app to control who can:

- edit topic mappings
- run replay actions
- inspect payload and error logs

Troubleshooting
---------------

[](#troubleshooting)

**Resource not visible** — ensure the plugin is registered on the panel you're viewing, then run `php artisan optimize:clear`.

**Class not found** — confirm both packages are installed and run `composer dump-autoload`.

**Customizations not applying** — plugin options are read at runtime from the current panel; make sure you configure them on the same `KafkaConsumerPlugin::make()` instance passed to `->plugins([...])`.

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md) for release history.

License
-------

[](#license)

The MIT License (MIT). See [LICENSE](LICENSE) for details.

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance91

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 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 ~0 days

Total

2

Last Release

93d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d542db92399434a617b7631fdcbbd2a7df8104107a29a6f9af6f8a5d48f3193b?d=identicon)[gurento](/maintainers/gurento)

---

Top Contributors

[![fglend](https://avatars.githubusercontent.com/u/179788429?v=4)](https://github.com/fglend "fglend (10 commits)")

---

Tags

laraveladminfilamentkafka

### Embed Badge

![Health badge](/badges/gurento-kafka-consumer-filament/health.svg)

```
[![Health](https://phpackages.com/badges/gurento-kafka-consumer-filament/health.svg)](https://phpackages.com/packages/gurento-kafka-consumer-filament)
```

###  Alternatives

[slowlyo/owl-admin

基于 laravel、amis 开发的后台框架~

61315.0k26](/packages/slowlyo-owl-admin)[a2insights/filament-saas

Filament Saas for A2Insights

191.7k](/packages/a2insights-filament-saas)

PHPackages © 2026

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