aanfarhan / laravel-chatbot
Context-aware chatbot package for Laravel: signed page context, OpenAI-compatible LLMs, streaming SSE, GDPR-friendly persistence.
v1.5.3
2026-06-03 23:37 UTC
Requires
- php: ^8.2
- guzzlehttp/guzzle: ^7.8
- illuminate/contracts: ^11.0 || ^12.0
- illuminate/http: ^11.0 || ^12.0
- illuminate/routing: ^11.0 || ^12.0
- illuminate/support: ^11.0 || ^12.0
- opis/json-schema: ^2.6
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.18
- orchestra/testbench: ^9.0 || ^10.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
- phpstan/phpstan: ^2.0
README
A Composer package that drops a context-aware chatbox onto any Laravel page. Declare what data the chat should see in your controller; the package handles signing, streaming, persistence, tool calling, and the frontend widget.
📚 Full documentation: aanfarhan.github.io/laravel-chatbot
Requirements
- PHP 8.2+
- Laravel 11 or 12
- An OpenAI-compatible LLM provider (OpenAI, Azure, OpenRouter, Groq, Ollama, etc.)
Install
composer require aanfarhan/laravel-chatbot php artisan chatbot:install
Use
use Aanfarhan\Chatbot\Facades\Chatbot; Route::get('/orders/{order}', function (Order $order) { Chatbot::context(['order' => new OrderResource($order)]); return view('orders.show', compact('order')); })->name('orders.show');
<body> @yield('content') @chatbot </body>
That's it. For everything else — channels, tool calling, client extractors, theming, GDPR, security, the full reference — see the documentation site.
Links
License
MIT