PHPackages                             werk365/larakafka - 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. [Queues &amp; Workers](/categories/queues)
4. /
5. werk365/larakafka

ActiveLibrary[Queues &amp; Workers](/categories/queues)

werk365/larakafka
=================

Kafka client for laravel that can easily handle producing and consuming messages

1.1.8(4y ago)2851MITPHP

Since Jan 29Pushed 4y ago1 watchersCompare

[ Source](https://github.com/365Werk/larakafka)[ Packagist](https://packagist.org/packages/werk365/larakafka)[ Docs](https://github.com/Werk365/larakafka)[ RSS](/packages/werk365-larakafka/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (4)Versions (15)Used By (1)

LaraKafka
=========

[](#larakafka)

[![Latest Version on Packagist](https://camo.githubusercontent.com/f6523edd3c89acb24a093ed45235c0d6d16e69cf7bd367613b13c1be5fcf95c8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7765726b3336352f6c6172616b61666b612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/werk365/larakafka)[![Total Downloads](https://camo.githubusercontent.com/c269ac75ee5e750a2b03b240b1b7481304575c96e118667f3c39bc4d6db66a8e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7765726b3336352f6c6172616b61666b612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/werk365/larakafka)[![StyleCI](https://camo.githubusercontent.com/f6524ea4e2bb12ca218e76c97285f1fa5c8e81100735bf63fbedaf0b4741003e/68747470733a2f2f7374796c6563692e696f2f7265706f732f3332313337363639312f736869656c64)](https://styleci.io/repos/321376691)

Kafka client package for use in Laravel. Based on [jobcloud/php-kafka-lib](https://github.com/jobcloud/php-kafka-lib).

This package supports an extension to produce spatie activitylog activity automatically. Use `werk365/larakafka-activity`.

Without much configuration (simply making sure the config has the required broker information and credentials), you'll be able to enable the Spatie Activity Logging on a model, and this package will take care of also sending that information to a kafka topic corresponding with your application name.

Besides this basic logging feature, it also allows you to produce and consume anything you would want.

Producing can be easily done in-code, and you can start any number of consumers through:

```
$ php artisan larakafka:consume {topic}
```

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

[](#installation)

Via Composer

```
$ composer require werk365/larakafka
```

Publish the config file using

```
$ php artisan vendor:publish --provider="Werk365\LaraKafka\LaraKafkaServiceProvider"
```

Configuration
-------------

[](#configuration)

The publishes config file looks as follows, you can find an explanation below it.

```
