Download the PHP package pkc/laravel-ai-chatbot without Composer

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

Laravel AI Chatbot

Lightweight, config-driven Laravel package for scoped AI chat using Groq (default free), OpenRouter, and OpenAI.

Requirements

Installation

The install command will:

  1. Ask which provider to use (groq / openai / openrouter)
  2. Prompt for the API key (secret input)
  3. Write values to .env
  4. Publish config/ai-chatbot.php

Local path development (before Packagist)

In your Laravel app composer.json:

Then:

Configuration

Published config: config/ai-chatbot.php

Key Description
default_provider groq, openai, or openrouter
timeout HTTP timeout in seconds (default 30)
providers.* API key, base URL, and model per provider
allowed_scopes Role-based topics (customer, admin)
rejection_message Polite off-topic refusal template
widget.* Floating bottom-page chat icon settings

Environment variables

Usage

Floating chatbot icon (UI)

Add this once near the end of your main Blade layout (before </body>):

That renders a fixed chat icon at the bottom of the page. Clicking it opens a chat panel that posts to POST /ai-chatbot/ask.

Optional widget settings in config/ai-chatbot.php (or env):

Key / env Description
widget.enabled / AI_CHATBOT_WIDGET_ENABLED Show or hide the icon (default true)
widget.title / AI_CHATBOT_WIDGET_TITLE Panel header title
widget.greeting / AI_CHATBOT_WIDGET_GREETING First bot message
widget.role / AI_CHATBOT_WIDGET_ROLE Role used for scope guardrails (customer / admin)
widget.position / AI_CHATBOT_WIDGET_POSITION right (default) or left
widget.primary_color / AI_CHATBOT_WIDGET_COLOR FAB / header color (default #0f766e)

Publish the Blade view to customize markup:

Service class

Facade

Response shape

Floating widget (automatic)

After install, a floating chat icon is auto-injected before </body> on:

No Blade @include is required. Toggle via .env:

Scope guardrails

The package injects a strict system prompt built from allowed_scopes for the given role. The model is instructed to refuse general knowledge, coding help, politics, and other off-topic questions using rejection_message.

Edit scopes in config/ai-chatbot.php to match your store.

Testing

Tests use Orchestra Testbench and Http::fake() — no live API key required.

Publishing to Packagist

See PUBLISHING.md for GitHub tagging, Packagist submission, and webhook setup.

Before publishing, replace placeholders:

License

MIT — see LICENSE.


All versions of laravel-ai-chatbot with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/http Version ^10.0|^11.0|^12.0
illuminate/console Version ^10.0|^11.0|^12.0
illuminate/routing Version ^10.0|^11.0|^12.0
illuminate/view Version ^10.0|^11.0|^12.0
illuminate/validation Version ^10.0|^11.0|^12.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 pkc/laravel-ai-chatbot contains the following files

Loading the files please wait ...