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
| Provider | Description | Internet Required |
|---|---|---|
| Claude (Anthropic) | Cloud-based, most capable | Yes |
| Ollama | Local models, private | No |
Setup
Claude (Anthropic)
- Get an API key from console.anthropic.com
- Open Laradebug Settings (
Cmd + ,) - Go to AI section
- Enter your API key
- Select Claude model (recommended: Claude Sonnet)
Ollama (Local)
- Install Ollama from ollama.com
- Pull a model:bash
# make sure it supports tool callings. ollama pull qwen3-coder:latest - Open Laradebug Settings
- Go to AI section
- Select "Ollama" as provider
- Enter Ollama URL (default:
http://localhost:11434) - 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 $100AI 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
Related Features
- Code Execution — Run AI-generated code
- Autocompletion — AI-powered suggestions
- SQL Logging — Verify generated queries