Download the PHP package emmanuel-saleem/laravel-chatbot without Composer
On this page you can find all versions of the php package emmanuel-saleem/laravel-chatbot. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download emmanuel-saleem/laravel-chatbot
More information about emmanuel-saleem/laravel-chatbot
Files in emmanuel-saleem/laravel-chatbot
Package laravel-chatbot
Short Description Laravel chatbot package for Q&A, FAQ and support. Database-driven intents with keyword AND/OR matching, conditional replies, buttons and variable substitution. Works with Laravel 8–12 and integrates with BotMan (web driver) for web/embedded chat widgets.
License MIT
Homepage https://github.com/es-77/laravel-chatbot
Informations about the package laravel-chatbot
Laravel Chatbot (Database-driven Q&A + BotMan)
A Laravel package that lets you manage chatbot Q&A in the database, with keyword matching (AND/OR), conditions, variable substitution, BotMan integration, an admin UI, a minimal web chat, and a floating chat widget.
Project links and contact
- Repository: github.com/es-77/laravel-chatbot
- Maintainer (LinkedIn): es77
- Email:
[email protected]
Requirements
- PHP >= 7.4
- Laravel ^8|^9|^10|^11|^12
1) Install the package
BotMan is included as a dependency. If you need the web driver explicitly:
2) Publish assets (config, migrations, views)
Publish everything:
Or selectively:
3) Run migrations
4) Routes
The package registers routes automatically:
- Web routes: admin pages and a BotMan endpoint
- API route:
POST /api/chatbot/messagefor programmatic access
If you are using a test/breeze app, protect admin routes with auth as needed.
5) Admin UI
Access Admin Pages
After installation, you can access the admin interface at:
- All Questions:
http://your-app.com/admin/bot-questions - Create Question:
http://your-app.com/admin/bot-questions/create - Import Questions:
http://your-app.com/admin/bot-questions/import
Or use route helpers in your code:
Note: Protect these routes with authentication middleware in your application. For example, in routes/web.php:
Create Questions
- Navigate to Create Question (
/admin/bot-questions/create) - Fill in the form:
- Question: Descriptive text for your reference
- Keywords: Add multiple keywords (press Enter or comma to add each keyword)
- Logic Operator: Choose OR (any keyword matches) or AND (all keywords must match)
- Answer: The bot's response (supports variables like
@{{user.name}},@{{user.email}},@{{session.deal_count}}) - Buttons (optional): Add interactive buttons with labels and URLs
- Priority: Higher numbers = higher priority (default: 0)
- Status: Active/Inactive toggle
- Click Save to create the question
Import Questions
- Navigate to Import Questions (
/admin/bot-questions/import) - Choose import method:
- Upload JSON File: Select a JSON file from your computer
- Paste JSON Content: Paste JSON directly into the textarea
- Use the provided JSON structure format (see the import page for details)
- Click Import Questions to process
JSON Structure Example:
Question Features
Each question supports:
- Keywords: Tag input (press Enter or comma to add)
- Logic Operator: OR (any keyword) or AND (all keywords)
- Variables in Answers:
@{{user.name}},@{{user.email}},@{{session.deal_count}} - Conditions (optional): Match based on session/user data
- Buttons (optional): Interactive buttons rendered in chat responses
6) Web Chat page (included)
The package includes a simple web chat at:
This view posts to the BotMan controller and renders replies and buttons.
7) Floating chat widget (corner icon)
Include the Blade snippet anywhere (typically at the end of your base layout before </body>):
The widget opens a compact chat panel and sends messages to the same BotMan web endpoint. No Tailwind required (uses inline styles).
8) API usage
Endpoint:
Payload:
Response (example):
See API_USAGE.md for more details.
9) Theme (dark/light) in test app
If you use the provided Breeze-based test app layout, a theme toggle is included in resources/views/components/admin-layout.blade.php. The theme persists in localStorage('theme') and toggles the <html>.dark class.
10) Development tips
-
After editing package views, if using them without publishing, just refresh. If you published views and you want to see updates, republish:
- Clear compiled views if needed:
11) Quick copy commands
12) Troubleshooting
-
If UI changes don't show after publishing, add
--forcewhen re-publishing views and clear compiled views: - For login-bound variables in the web chat, ensure Ajax requests include cookies. The default chat sends
credentials: 'same-origin'. - If you see "Unable to locate component [admin-layout]", the package includes a default admin layout. If you published views, ensure your published
admin-layout.blade.phpexists or remove it to use the package's default.
Happy building! If something feels rough, open an issue or send a PR.
All versions of laravel-chatbot with dependencies
illuminate/support Version ^8.0|^9.0|^10.0|^11.0|^12.0
botman/botman Version ^2.6
botman/driver-web Version ^1.5