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.
Download pkc/laravel-ai-chatbot
More information about pkc/laravel-ai-chatbot
Files in pkc/laravel-ai-chatbot
Package laravel-ai-chatbot
Short Description Laravel AI Chatbot — scoped AI chat for Laravel with Groq, OpenRouter, and OpenAI support.
License MIT
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
- PHP
^8.2 - Laravel
^10|^11|^12
Installation
The install command will:
- Ask which provider to use (
groq/openai/openrouter) - Prompt for the API key (secret input)
- Write values to
.env - 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:
- Storefront pages →
customerrole (Store Assistant) - Admin pages (
/admin/*) →adminrole (Admin Assistant)
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:
- Composer name:
pkc/laravel-ai-chatbot - PHP namespace:
Laradevsumon\AIChatbot - Author name/email in
composer.jsonandLICENSE
License
MIT — see LICENSE.
All versions of laravel-ai-chatbot with dependencies
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