Download the PHP package rumenx/php-chatbot without Composer

On this page you can find all versions of the php package rumenx/php-chatbot. 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 php-chatbot

php-chatbot

CI Analyze Style codecov

php-chatbot is a modern, framework-agnostic PHP package for integrating an AI-powered chat popup into any web application. It features out-of-the-box support for Laravel and Symfony, a flexible model abstraction for using OpenAI, Anthropic, xAI, Google Gemini, Meta, and more, and is designed for easy customization and extension. Build your own UI or use the provided minimal frontend as a starting point. High test coverage, static analysis, and coding standards are included.

Features

Supported AI Providers & Models

Installation

Laravel

Symfony

Usage

  1. Add the chat popup to your layout (see /resources/views for examples).
  2. Configure your preferred AI model and prompts in the config file (src/Config/phpchatbot.php).
  3. Optionally, customize the frontend (CSS/JS) in /resources.

API Keys & Credentials

Never hardcode API keys or secrets in your codebase.

Quick Start

Example .env

API Endpoint Contract

Symfony Backend Example

Testing

Running Tests with Coverage

Static Analysis

Coding Standards

Security

Rate Limiting & Abuse Prevention

You can implement rate limiting and abuse prevention in your backend. For Laravel, use built-in middleware:

For plain PHP, you can use a simple session or IP-based limiter, or integrate a package like malkusch/lock or Redis.

JavaScript Framework Components

You can use the provided chat popup as a plain HTML/JS snippet, or integrate a modern component for Vue, React, or Angular:

JS Component Usage

  1. Copy the component into your app's source tree.
  2. Import and register it in your app (see your framework's docs).
  3. Customize the backend endpoint (/php-chatbot/message) as needed.
  4. Build your assets (e.g. with Vite, Webpack, or your framework's CLI).

Example (Vue)

Example (React)

Example (Angular)

JS Component Customization

TypeScript Example (React)

A modern TypeScript React chatbot component is provided as an example in resources/js/components/PhpChatbotTs.tsx.

How to use:

  1. Copy PhpChatbotTs.tsx into your React app's components folder.
  2. Import and use it in your app:

  3. Make sure your backend endpoint /php-chatbot/message is set up as described above.
  4. Style as needed (the component uses inline styles for demo purposes, but you can use your own CSS/SCSS).

This component is a minimal, framework-agnostic starting point. You are encouraged to extend or restyle it to fit your app.

Backend Integration Example

To handle chat requests, add a route/controller in your backend (Laravel, Symfony, or plain PHP) that receives POST requests at /php-chatbot/message and returns a JSON response. Example for Laravel:

For plain PHP, use:

Frontend Styles (SCSS)

The chat popup styles are written in modern SCSS for maintainability. You can find the source in resources/css/chatbot.scss.

To compile SCSS to CSS:

  1. Install Sass (if you haven't already):

  2. Add this script to your package.json:

  3. Compile SCSS:

Or use the Sass CLI directly:

To watch for changes automatically:

Only commit the compiled chatbot.css for production/deployment. For more options, see Sass documentation.

Customizing Frontend Styles & Views (Best Practice)

The provided CSS/SCSS and view files (resources/css/, resources/views/) are optional and basic. They are meant as a starting point for your own implementation. You are encouraged to build your own UI and styles on top of or instead of these defaults.

Do not edit files directly in the vendor/ folder or inside the package source.

How to Safely Override Views and Styles

Important: If you edit files directly in vendor/rumenx/php-chatbot/, your changes will be lost on the next composer update. Always override or extend in your own app.

Principle

Best Practices

What's Included

Feature Location/Example Optional/Required
PHP Core Classes src/ Required
Laravel Adapter src/Adapters/Laravel/ Optional
Symfony Adapter src/Adapters/Symfony/ Optional
Config File src/Config/phpchatbot.php Required
Blade/PHP Views resources/views/ Optional
CSS/SCSS resources/css/chatbot.scss/chatbot.css Optional
JS/TS Components resources/js/components/ Optional
Example .env .env.example Optional
Tests tests/ Optional

Questions & Support

For questions, issues, or feature requests, please use the GitHub Issues page.

Contributing

See CONTRIBUTING.md.

License

MIT. See LICENSE.md.


All versions of php-chatbot with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
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 rumenx/php-chatbot contains the following files

Loading the files please wait ....