Download the PHP package kauffinger/livewire-chat-kit without Composer

On this page you can find all versions of the php package kauffinger/livewire-chat-kit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package livewire-chat-kit

Livewire Chat Kit

Latest Version on Packagist GitHub Tests Action Status Linter Action Status Total Downloads

A Laravel Starter Kit for building LLM-powered chat interfaces with Livewire, FluxUI, and Prism. Jump right into the LLM party without touching (much) JavaScript, while still having a good-looking and effortlessly feeling chat interface.

This starter kit provides a clean, simple foundation for creating chat applications. It's designed to get you sending your first chat messages to an LLM instantly.

Features

Installation

You can install this starter kit into a new Laravel application using Composer:

After installation, make sure to:

  1. Run migrations: php artisan migrate
  2. Install NPM dependencies: npm install
  3. Build assets: npm run dev (or npm run build for production)

Getting Started

1. Configure LLM Provider

This starter kit uses Prism to interact with LLMs. By default, it's configured to use OpenAI's gpt-4o-mini. You'll need to add your API key to your .env file.

You can easily switch to other providers supported by Prism (like Anthropic) by modifying the Chat.php component. For example, to use Claude:

Remember to add the corresponding API key to your .env file (e.g., ANTHROPIC_API_KEY).

2. Explore the Chat Interface

Navigate to your application's /dashboard route (or wherever you've set up the chat component) to start interacting with the chat interface.

Core Components

app/Livewire/Chat.php

This is the heart of the chat functionality.

resources/views/livewire/chat.blade.php

This Blade view renders the chat interface.

How it Works

  1. User types a message in x-chat.message-input and hits send.
  2. sendMessage() in Chat.php is triggered.
    • The user's message is added to the $messages array.
    • The input field is cleared.
    • $this->js('$wire.runChatToolLoop()') is called, which immediately invokes the runChatToolLoop() method. This allows the UI to update with the user's message before the LLM call.
  3. runChatToolLoop():
    • Constructs a request to the LLM using Prism, including the system prompt and the current chat history.
    • The request is sent as a stream.
    • As tokens arrive from the LLM:
      • They are appended to a local $message variable.
      • The stream() method sends the accumulated $message (converted to markdown) to the frontend, updating the part of the view listening to streamed-message. This is typically handled by the x-chat.assistant-message component.
  4. Once the LLM finishes generating its response:
    • The complete assistant message is added to the $messages array. The temporary streamed display is effectively replaced by the final message in the loop.

Contributing

Contributions are welcome! If you'd like to improve the Livewire Chat Kit, please feel free to:

Please visit the GitHub repository to contribute.

License

This project is open-sourced software licensed under the MIT license.


All versions of livewire-chat-kit with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
laravel/framework Version ^12.0
laravel/tinker Version ^2.10.1
livewire/flux Version ^2.1.1
livewire/volt Version ^1.7.0
prism-php/prism Version ^0.68.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kauffinger/livewire-chat-kit contains the following files

Loading the files please wait ....