PHPackages                             ziffmedia/laravel-ksql - 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. [Database &amp; ORM](/categories/database)
4. /
5. ziffmedia/laravel-ksql

ActiveLibrary[Database &amp; ORM](/categories/database)

ziffmedia/laravel-ksql
======================

v0.3.1(3y ago)07.8k[1 PRs](https://github.com/ziffmedia/laravel-ksql/pulls)MITPHPPHP ^8.1

Since Mar 6Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ziffmedia/laravel-ksql)[ Packagist](https://packagist.org/packages/ziffmedia/laravel-ksql)[ RSS](/packages/ziffmedia-laravel-ksql/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (7)Versions (11)Used By (0)

Laravel KSQL
============

[](#laravel-ksql)

A Laravel-focused client for KsqlDB's REST api. This package is designed to integrate tightly with laravel but does not strictly require it. The core KSQL client only depends on `symfony/http-client`.

### Requirements

[](#requirements)

- PHP 8.1 or later

### Installation

[](#installation)

Install the package via composer: `composer require ziffmedia/laravel-ksql`

Publish the `ksql.php` config file: ` php artisan vendor:publish --provider "ZiffMedia\LaravelKsql\KsqlServiceProvider"`

Usage
-----

[](#usage)

**Construct a basic KSQL client by hand:**

```
$client = new Ziffmedia\LaravelKsql\Client("http://my.ksqldb.server:8088");
```

**Construct a basic KSQL client by hand, with HTTP basic authentication:**

```
$client = new Ziffmedia\LaravelKsql\Client("http://my.ksqldb.server:8088", "myusername", "mypassword");
```

*Note: if using Confluent Cloud, the username and password should be a KSQL api key and api secret, respectively.*

**Use the Laravel DI container to factory a client based on config values:**

```
$client = app(ZiffMedia\LaravelKsql\KsqlClient::class)
```

### Config file and environment variables

[](#config-file-and-environment-variables)

```
