asyntai/filament-ai-chatbot
AsyntAI Filament AI Chatbot adds an AI-powered chat assistant to Filament admin panels. Drop in a chat widget, connect your AI provider, and let users ask questions, get help, or query data without leaving the dashboard. Configurable and easy to install via Composer.
Start with the package README and published config file, then confirm the plugin registration pattern for your Filament version. For v1.0.0 the first practical use case is adding an AI assistant to an admin or support panel so staff can ask questions without leaving Filament.
Minimal path:
.env / config/asyntai.php, keeping separate IDs per environment and per panel where needed.Typical panel registration shape:
public function panel(Panel $panel): Panel
{
return $panel
->plugin(
AsyntaiPlugin::make()
->widgetId(config('asyntai.widgets.admin'))
->userContext(fn ($user) => [
'id' => $user?->id,
'name' => $user?->name,
'role' => $user?->getRoleNames()->first(),
])
->visible(fn () => auth()->user()?->can('use-asyntai'))
);
}
Check the exact plugin class, method names, and Blade component tag in the package README; v1.0.0 is the first release, so the README is the source of truth.
Use one widget ID per panel. In multi-panel apps, give admin, staff, and customer panels distinct Asyntai widget IDs. Keep them in config rather than hardcoding them in panel providers:
// config/asyntai.php
'widgets' => [
'admin' => env('ASYNTai_ADMIN_WIDGET_ID'),
'support' => env('ASYNTai_SUPPORT_WIDGET_ID'),
'public' => env('ASYNTai_PUBLIC_WIDGET_ID'),
],
Then register each panel with its own ID and visibility rule. This prevents a customer-facing assistant from appearing in an internal panel, or vice versa.
Treat user context as a deliberate contract. Pass only what the assistant needs: stable user ID, display name, role, tenant/team ID, locale, or plan. Avoid dumping the entire user model, request payloads, tokens, or sensitive customer data. Use null-safe closures because guests may hit public pages:
->userContext(fn ($user) => $user ? [
'id' => $user->id,
'name' => $user->name,
'role' => $user->getRoleNames()->first(),
'tenant' => $user->tenant_id,
] : [])
Use visibility rules for rollout, not authorization. Combine auth checks, roles, feature flags, and environment checks:
->visible(fn () => app()->isProduction()
? auth()->user()?->can('use-asyntai')
: auth()->check())
Still enforce real permissions in policies and controllers. The widget visibility is a UI convenience.
Public pages need route-level placement. Put the Blade component only on pages where public chat is intended, such as a help center or marketing contact page. If the package exposes a component tag, keep it in a shared layout partial so you can enable/disable it per route or config flag.
Share context builders. If several panels need similar context, extract a small resolver class or closure factory. That keeps role/tenant logic consistent and makes later changes easier.
Test as a Filament panel feature. Add a smoke test that boots the relevant panel and asserts the assistant is present or absent according to visibility rules. This catches provider registration mistakes and panel-specific ID mix-ups early.
php artisan config:clear locally and ensure config:cache is rebuilt during deployment. Filament/panel caches may also need clearing if the widget does not appear.How can I help you explore Laravel packages today?