database

database is an agent for Claude Code from mischasigtermans/laravel-altitude. It costs 11 tokens per session (529 once invoked), scanned A, original, MIT.

A specialist guide for Laravel databases, including database structure, Eloquent models, migrations, and queries. Eloquent is Laravel's way to work with database records as PHP objects.

In plain words
What is it for?
Designing schemas, writing migrations, defining relationships, adding indexes or soft deletion, inspecting data, testing queries, and working with Eloquent models.
Why use it?
It provides patterns for creating tables, linking records, choosing keys, and checking queries before database changes are made.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md).

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/mischasigtermans/laravel-altitude/database
Clone the repo
git clone --depth 1 https://github.com/mischasigtermans/laravel-altitude

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for database

README.md
[![agentmods](https://agentmods.dev/badge/agents/mischasigtermans/laravel-altitude/database.svg)](https://agentmods.dev/agents/mischasigtermans/laravel-altitude/database)
Your own site
<a href="https://agentmods.dev/agents/mischasigtermans/laravel-altitude/database"><img src="https://agentmods.dev/badge/agents/mischasigtermans/laravel-altitude/database.svg" alt="Measured on agentmods" height="20"></a>
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 529 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00011 $0.00529
Opus 5 $0.00005 $0.00264
Sonnet 5 $0.00002 $0.00106
Haiku 4.5 $0.00001 $0.00053

Measured 6d ago against content hash f46543811fc6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

database scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

stubs/agents/database.md · 76 lines

What it actually says

Database Specialist

You are a database specialist. Design schemas, write migrations, optimize queries.

Tools

mcp__laravel-boost__database-schema   # View schema
mcp__laravel-boost__database-query    # Run SQL
mcp__laravel-boost__tinker            # Test Eloquent
mcp__laravel-boost__search-docs       # Documentation

Migration Patterns

Standard Table

Schema::create('posts', function (Blueprint $table) {
    $table->id();
    $table->foreignId('user_id')->constrained()->cascadeOnDelete();
    $table->string('title');
    $table->timestamps();
    $table->softDeletes();
    $table->index(['user_id', 'status']);
});

UUID Primary Key

$table->uuid('id')->primary();
$table->foreignUuid('customer_id')->constrained('customers');

Composite Key (Pivot)

$table->foreignId('user_id')->constrained()->cascadeOnDelete();
$table->foreignId('role_id')->constrained()->cascadeOnDelete();
$table->primary(['user_id', 'role_id']);

Relationships

public function user(): BelongsTo { return $this->belongsTo(User::class); }
public function posts(): HasMany { return $this->hasMany(Post::class); }
public function roles(): BelongsToMany { return $this->belongsToMany(Role::class)->withTimestamps(); }
public function tags(): BelongsToMany { return $this->belongsToMany(Tag::class)->withPivot('order'); }

Query Optimization

// Eager load
$posts = Post::with(['user', 'comments.author'])->get();

// Count without loading
$posts = Post::withCount('comments')->get();

Use Laravel Debugbar for N+1 detection.

Best Practices

  1. Always use migrations
  2. Add indexes for queried columns
  3. Use foreign keys
  4. Use soft deletes for recoverable data
  5. Keep migrations reversible
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 76 lines · 11 tokens per session scan A f46543811fc6

Subscribe to this mod's changes

database is an agent published in the GitHub repository mischasigtermans/laravel-altitude (122 stars, last pushed 5mo ago), licensed MIT. It adds 11 tokens to every session and 529 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

artisan-specialist

Database specialist for Laravel, runs in the "database" extra phase after development. Elaborates migration column types/indexes/constraints/foreign keys, writes factories and seeders, runs php artisan migrate and verifies schema. Do NOT use for: application logic (laravel-architect), tests (qa-engineer), optimization…

AratKruglik/claude-sdlc · 80 tokens

php-expert

Use when: composer.json present WITHOUT an artisan file. Do NOT use for: Laravel apps (composer.json + artisan → laravel-expert), frontend (framework experts).

fusengine/agents · 38 tokens

laravel-eloquent

Advanced Eloquent ORM specialist for Laravel 13. Expert in relationship mapping, query optimization, N+1 elimination, domain-driven model design, custom builders, scopes, casts, events, and performance tuning.

elmochilyas/laraskills · 47 tokens

index

Agents are the core of the Synapse library. Every component, such as Tools, Memory, or OutputSchema, must be attached to an agent.

UseTheFork/synapse · 0 tokens

php-expert

Specialized in developing efficient, secure, and modern PHP applications adhering to best practices.

andisab/swe-marketplace · 21 tokens

ef-core-specialist

Database expert for Entity Framework Core — DbContext design, efficient LINQ queries, migrations, interceptors, compiled queries, and data access optimization. Use for schema changes and migrations, query performance issues (N+1, missing indexes), entity configuration, or any database-layer work.

codewithmukesh/dotnet-claude-kit · 61 tokens