Botovis

Getting Started

Install and set up Botovis in your Laravel application in minutes

Get Botovis running in your Laravel application in under 5 minutes. This guide will walk you through installation, configuration, and adding the chat widget to your app.

Requirements

  • PHP 8.1 or higher
  • Laravel 10, 11, or 12
  • An LLM API key (OpenAI, Anthropic, or a local Ollama instance)
  • A database with at least one Eloquent model

Installation

Install the package

composer require botovis/botovis-laravel

This will install the core package and the Laravel integration together.

Publish configuration and assets

php artisan vendor:publish --tag=botovis-config
php artisan vendor:publish --tag=botovis-assets

This creates config/botovis.php and copies the widget JavaScript bundle to public/vendor/botovis/.

Run migrations

Botovis stores conversation history in your database. Publish and run the migrations:

php artisan vendor:publish --tag=botovis-migrations
php artisan migrate

Configure your LLM provider

Add your API credentials to your .env file. Choose your preferred provider:

BOTOVIS_LLM_DRIVER=openai
BOTOVIS_OPENAI_API_KEY=sk-your-openai-key
BOTOVIS_OPENAI_MODEL=gpt-4o
BOTOVIS_LLM_DRIVER=anthropic
BOTOVIS_ANTHROPIC_API_KEY=sk-ant-your-key
BOTOVIS_ANTHROPIC_MODEL=claude-sonnet-4-20250514
BOTOVIS_LLM_DRIVER=ollama
BOTOVIS_OLLAMA_BASE_URL=http://localhost:11434
BOTOVIS_OLLAMA_MODEL=llama3

Configure model whitelist

Open config/botovis.php and add the Eloquent models you want Botovis to access:

'models' => [
    \App\Models\User::class    => ['read'],
    \App\Models\Product::class => ['create', 'read', 'update', 'delete'],
    \App\Models\Order::class   => ['create', 'read', 'update'],
    // Add your models here with their allowed CRUD actions
],

Important

Only models listed in the models array will be visible to the AI. Each model maps to an array of allowed actions (create, read, update, delete). Models not listed here are completely invisible — they won't appear in the schema or be queryable. Use php artisan botovis:models to interactively select models and generate this config.

Add the widget to your layout

Add the Blade directive to your main layout file, just before the closing </body> tag:

<!-- resources/views/layouts/app.blade.php -->
<!DOCTYPE html>
<html>
<head>...</head>
<body>
    {{ $slot }}

    @botovisWidget
</body>
</html>

Verify the installation

Start your development server and run the discovery command to verify everything works:

php artisan botovis:discover

You should see a list of your registered models with their tables, columns, and relationships. Open your app in the browser — you'll see the Botovis chat widget in the bottom-right corner.

Quick Test

Try asking the widget something about your data:

  • "How many users do we have?"
  • "Show me the latest 5 orders"
  • "What are the most popular products?"

The agent will analyze your question, use the appropriate tools to query the database, and respond in natural language.

Troubleshooting

Widget not showing?

Make sure you published the assets (--tag=botovis-assets) and that the JavaScript file exists at public/vendor/botovis/botovis-widget.iife.js. Also ensure your user is authenticated — by default, Botovis requires authentication.

API key errors?

Double-check your .env values. Run php artisan config:clear after making changes. You can verify your schema with php artisan botovis:discover.

No models discovered?

Ensure you've added your Eloquent models to the models array in config/botovis.php. Models must use Illuminate\Database\Eloquent\Model as their base class.

Next Steps

  • Configuration — Fine-tune LLM settings, security, and behavior
  • Security — Set up role-based access control
  • Architecture — Understand how the ReAct agent loop works
  • Tools — Learn about built-in tools and create custom ones

On this page