Skip to content

AI Assistant

Get intelligent help with your Laravel code using Claude or local Ollama models.

Overview

The AI Assistant helps you:

  • Write and explain Laravel code
  • Generate SQL queries from natural language
  • Debug errors and exceptions
  • Understand complex Eloquent relationships

Supported Providers

ProviderDescriptionInternet Required
Claude (Anthropic)Cloud-based, most capableYes
OllamaLocal models, privateNo

Setup

Claude (Anthropic)

  1. Get an API key from console.anthropic.com
  2. Open Laradebug Settings (Cmd + ,)
  3. Go to AI section
  4. Enter your API key
  5. Select Claude model (recommended: Claude Sonnet)

Ollama (Local)

  1. Install Ollama from ollama.com
  2. Pull a model:
    bash
    # make sure it supports tool callings.
    ollama pull qwen3-coder:latest
  3. Open Laradebug Settings
  4. Go to AI section
  5. Select "Ollama" as provider
  6. Enter Ollama URL (default: http://localhost:11434)
  7. Select your model

Using the AI Assistant

Opening the Chat

  • Click the AI icon in the sidebar
  • Or use keyboard shortcut Cmd + Shift + A

Asking Questions

Type your question naturally:

How do I get all users with more than 5 posts?

The AI responds with Laravel code:

php
User::withCount('posts')
    ->having('posts_count', '>', 5)
    ->get();

Context Awareness

The AI knows about:

  • Your current code in the editor
  • Recent SQL queries
  • Error messages
  • Your project structure

SQL Generation

Natural Language to SQL

Ask for queries in plain English:

Find all orders from last month with total over $100

AI generates:

php
Order::where('created_at', '>=', now()->subMonth())
    ->where('total', '>', 100)
    ->get();

Tool Approval

When the AI suggests code that could modify data, Laradebug asks for approval:

┌─────────────────────────────────────────────────┐
│ AI wants to run:                                │
│                                                 │
│ User::where('inactive', true)->delete();        │
│                                                 │
│ This will delete records.                       │
│                                                 │
│         [Cancel]    [Run Code]                  │
└─────────────────────────────────────────────────┘

Review before executing any AI-suggested code.

Privacy

Claude (Cloud)

  • Your code is sent to Anthropic's servers
  • Subject to Anthropic's privacy policy
  • Good for: General Laravel code

Ollama (Local)

  • Everything stays on your machine
  • No internet required
  • Good for: Sensitive/proprietary code

Built for Laravel developers.