Download the PHP package backtik-ch/laravel-kchat-sdk without Composer

On this page you can find all versions of the php package backtik-ch/laravel-kchat-sdk. 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 laravel-kchat-sdk

Laravel kChat SDK

Laravel SDK for sending kChat messages with a bot token and reading kChat users.

Installation

Publish the config:

Configuration

KCHAT_TOKEN is the bot token used as Authorization: Bearer .... KCHAT_BOT_USER_ID is required for direct messages because the SDK creates or reuses the private channel between the bot and the target user.

Messages

Send to a channel by channel id:

Markdown is just message content:

Send a private message by user id:

Send a private message by username:

Reply in a thread:

Read, update and delete posts:

Override the bot display name or avatar for one message:

Add color attachments:

Attach a local file:

Users

Exceptions

Public methods return typed DTOs or throw an exception. They do not return false.

Available exceptions:

Exceptions include the endpoint, HTTP status when available, and non-sensitive context. The SDK never includes the bot token in exception messages.

DTOs

The SDK returns typed DTOs:

Each DTO exposes common fields with methods such as id(), message(), username(), and keeps the full payload available through raw().

Security

Keep the bot token in config or .env; do not hard-code it in application code. The bot must have permission to post in target channels, create or access direct message channels, upload files, and optionally use message display overrides if your kChat server restricts that feature.

attachFile() accepts local files only. It validates that the path exists and is readable before upload.

Laravel Boost

This package ships with Laravel Boost resources. If your application uses Laravel Boost, run the installer to publish the package guidelines and skills automatically:

The published resources include:

Testing

Testing in a Local Laravel App

To test this package inside a Laravel application before publishing a release, use a local Composer path repository.

In the Laravel app composer.json, add:

Adjust url to the relative path between the Laravel app and this package.

Then install the package in the Laravel app:

Publish the config in the Laravel app:

Configure the Laravel app .env with the kChat server URL, bot token, and bot user id.

You can test quickly with Tinker:

Or with a temporary route:

With "symlink": true, changes made in this package are immediately used by the Laravel app. If you add or move classes, run this in the Laravel app:


All versions of laravel-kchat-sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^11.0||^12.0||^13.0
illuminate/http Version ^11.0||^12.0||^13.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 backtik-ch/laravel-kchat-sdk contains the following files

Loading the files please wait ...