PHPackages                             krafftd/chat - 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. krafftd/chat

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

krafftd/chat
============

Embed the Krafftd Chat widget into any Laravel application.

00PHP

Since Apr 15Pushed 3mo agoCompare

[ Source](https://github.com/Ne0626/krafftd-chat-laravel)[ Packagist](https://packagist.org/packages/krafftd/chat)[ RSS](/packages/krafftd-chat/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Krafftd Chat — Laravel Package
==============================

[](#krafftd-chat--laravel-package)

Embed the **Krafftd Chat** widget into any existing Laravel application in minutes.

Once installed, the chat bubble is automatically injected on every page of your site — no manual template changes required.

---

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

[](#requirements)

- PHP 8.1 or higher
- Laravel 10, 11, or 12

---

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

[](#installation)

### Step 1 — Install via Composer

[](#step-1--install-via-composer)

```
composer require krafftd/chat
```

### Step 2 — Run the install wizard

[](#step-2--run-the-install-wizard)

```
php artisan krafftd:chat:install
```

The wizard will:

- Publish the config file to `config/krafftd-chat.php`
- Ask which layout file to inject the sidebar nav item into (optional)

### Step 3 — Add your credentials to `.env`

[](#step-3--add-your-credentials-to-env)

```
KRAFFTD_CHAT_SERVER_URL=https://chat.yourdomain.com
KRAFFTD_CHAT_CLIENT_SLUG=your-client-slug
KRAFFTD_CHAT_WIDGET_TOKEN=your-widget-token
```

You can find your **Client Slug** and **Widget Token** in your Krafftd Chat admin panel under **Settings → Widget Code** or on the **Clients** page if provided by your administrator.

That's it. The chat widget will now appear on every page of your Laravel application.

---

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

[](#configuration)

The published config file at `config/krafftd-chat.php` contains the following options:

```
return [

    // Base URL of the Krafftd Chat server
    'server_url' => env('KRAFFTD_CHAT_SERVER_URL', ''),

    // Your unique client identifier
    'client_slug' => env('KRAFFTD_CHAT_CLIENT_SLUG', ''),

    // Widget authentication token
    'widget_token' => env('KRAFFTD_CHAT_WIDGET_TOKEN', ''),

    // Set to false to disable auto-injection and apply the middleware manually
    'inject_middleware' => env('KRAFFTD_CHAT_INJECT', true),

];
```

---

Sidebar Nav Item (Optional)
---------------------------

[](#sidebar-nav-item-optional)

The package includes a Blade component that renders a link back to your Krafftd Chat admin panel. This is useful if you want your team to access the chat dashboard directly from your app's sidebar.

```

```

You can also customize the label:

```

```

The install wizard can inject this automatically — just provide your layout file path when prompted.

---

Manual Middleware (Advanced)
----------------------------

[](#manual-middleware-advanced)

By default, the widget script is injected automatically on all `web` responses. If you prefer to control which routes get the widget, disable auto-injection in your `.env`:

```
KRAFFTD_CHAT_INJECT=false
```

Then apply the middleware manually to specific routes or groups in `routes/web.php`:

```
Route::middleware('krafftd.chat.inject')->group(function () {
    Route::get('/', HomeController::class);
});
```

---

Publishing Views (Optional)
---------------------------

[](#publishing-views-optional)

To customize the widget script partial or the nav item template, publish the package views:

```
php artisan vendor:publish --tag=krafftd-chat-views
```

Views will be copied to `resources/views/vendor/krafftd-chat/`.

---

How It Works
------------

[](#how-it-works)

FeatureDetails**Widget injection**Middleware appends a `` tag before `` on every 200 HTML response**No routes added**All widget traffic goes directly to the Krafftd Chat server**No database changes**No migrations, no models**Zero JS to write**The widget script handles everything on the client side---

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

[](#troubleshooting)

**Widget is not appearing**

- Make sure all three `.env` values are set and not empty
- Run `php artisan config:clear` after updating `.env`
- Check that the response content type is `text/html` (the middleware skips JSON and redirects)

**Nav item link goes to `#`**

- Ensure `KRAFFTD_CHAT_SERVER_URL` is set in your `.env`

**Auto-injection is not working on some pages**

- The middleware only injects on HTTP 200 responses containing ``
- API routes and redirects are skipped automatically

---

License
-------

[](#license)

MIT

###  Health Score

18

—

LowBetter than 7% of packages

Maintenance54

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/91310097?v=4)[Juan](/maintainers/Ne0626)[@Ne0626](https://github.com/Ne0626)

---

Top Contributors

[![Ne0626](https://avatars.githubusercontent.com/u/91310097?v=4)](https://github.com/Ne0626 "Ne0626 (3 commits)")

### Embed Badge

![Health badge](/badges/krafftd-chat/health.svg)

```
[![Health](https://phpackages.com/badges/krafftd-chat/health.svg)](https://phpackages.com/packages/krafftd-chat)
```

###  Alternatives

[snapappointments/bootstrap-select

The jQuery plugin that brings select elements into the 21st century with intuitive multiselection, searching, and much more. Now with Bootstrap 4 support.

9.8k501.2k3](/packages/snapappointments-bootstrap-select)

PHPackages © 2026

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