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.
npx skills add elmochilyas/laraskills --skill laravel-eloquentgit clone --depth 1 https://github.com/elmochilyas/laraskillsWrote 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.
[](https://agentmods.dev/skills/elmochilyas/laraskills/laravel-eloquent)<a href="https://agentmods.dev/skills/elmochilyas/laraskills/laravel-eloquent"><img src="https://agentmods.dev/badge/skills/elmochilyas/laraskills/laravel-eloquent/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/elmochilyas/laraskills/laravel-eloquent"><img src="https://agentmods.dev/badge/skills/elmochilyas/laraskills/laravel-eloquent.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.08812 |
| Opus 5 | $0.00000 | $0.04406 |
| Sonnet 5 | $0.00000 | $0.01762 |
| Haiku 4.5 | $0.00000 | $0.00881 |
Grade A, and why
laravel-eloquent 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 12d 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.
How it starts
The opening of the file, as written. The whole thing — 1,506 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Laravel 13 Expert Skill: Advanced Eloquent Architecture, Performance & Domain Modeling
When to Use
Use this skill when building Laravel 13 applications that require deep Eloquent knowledge: complex relationship mapping, query performance optimization, domain-driven model design, and advanced ORM features. This is the definitive reference for Eloquent beyond simple CRUD.
Core Philosophy
Eloquent Is Not Your Architecture
Eloquent is:
- ORM (Object-Relational Mapper)
- Data Mapper Hybrid
- Query Builder
- Persistence Layer
Eloquent is NOT:
- Business Layer
- Application Layer
- Domain Layer
Models can contain domain behavior, but infrastructure concerns belong elsewhere. Avoid "Fat Models" that mix unrelated business logic, email sending, API calls, and file generation.
Architecture Flow
Controller (thin — validation, auth, response)
↓
Action / DTO (orchestration, type-safe data)
↓
Domain Service (business logic)
↓
Repository / Query Object / Custom Builder
↓
Model / Eloquent (persistence)
↓
Database
1. Relationships
General Rules
Always define explicit relationships — never access $post->user_id directly.
// BAD
$userId = $post->user_id;
// GOOD
$post->user;
Always declare return types on relationship methods:
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);
}
Naming conventions:
- Singular for single relations:
user(),profile(),company(),subscription() - Plural for collections:
posts(),comments(),roles(),tags()
1.1 Morph Relations (Polymorphic Single)
Use when multiple model types can own a single related model. Best for: comments, media, attachments, activity logs, notifications, likes.
// Comment belongs to Post, Video, or Product
class Comment extends Model
{
public function commentable(): MorphTo
{
return $this->morphTo();
}
}
class Post extends Model
{
public function comments(): MorphMany
{
return $this->morphMany(Comment::class, 'commentable');
}
}
class Video extends Model
{
public function comments(): MorphMany
{
return $this->morphMany(Comment::class, 'commentable');
}
}
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.
- 12d ago First seen · 1,506 lines · 0 tokens per session scan A 0d4cde092674
laravel-eloquent is a skill published in the GitHub repository elmochilyas/laraskills (8 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 8,812 tokens. 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-31.
Other skills, from other repositories
truss-schema
Ground a database schema change in this application's real structure using Laravel Truss. Use when adding or altering tables, columns, indexes, or foreign keys, when a migration needs to match what is already there, or when you need to know what a migration actually changed. Structure only, never data.
laravel-database-optimization
Laravel database optimization patterns. Use when writing Eloquent queries, creating migrations, configuring caching, debugging slow queries, or optimizing database performance. Triggers on tasks involving N+1 queries, indexing, Redis caching, pagination, or database transactions.
check-batch-processing
Analyzes PHP code for batch processing issues. Detects single-item vs bulk operations, missing batch inserts, individual API calls in loops, transaction overhead.
eloquent-patterns
Eloquent ORM best practices: query builders, scopes, relations, N+1 prevention, batch operations, soft deletes, model events, raw queries when needed. Apply when: writing or reviewing Eloquent queries and model interactions. Activated automatically by laravel-plugin/stack.md as a convention skill for the development…
laravel-migrations
Use when designing a database schema or managing Laravel 13 migrations — Schema Builder, columns, indexes, foreign keys, or seeders.
laravel-eloquent
Eloquent and query-layer engineering rules for Laravel — eliminating N+1, choosing a pagination strategy, short atomic transactions, casts and scopes on the model, where raw SQL is allowed, and how migrations declare the schema those queries depend on. Use when writing or reviewing Eloquent models, migrations, query…