Agent skill
laravel-eloquent
Master Eloquent ORM with relationships, scopes, casts, observers, and query optimization. Use when creating models, defining relationships, writing queries, or optimizing database access.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/laravel-eloquent-fusengine-agents-678fc4d3
SKILL.md
Laravel Eloquent ORM
Documentation
Eloquent Core
- eloquent.md - Eloquent ORM basics
- eloquent-relationships.md - Relationships
- eloquent-collections.md - Eloquent collections
- eloquent-mutators.md - Accessors, mutators & casting
- eloquent-serialization.md - Serialization
- eloquent-factories.md - Model factories
- eloquent-resources.md - API Resources
Collections & Search
- collections.md - Laravel collections
- scout.md - Full-text search
Model Template
<?php
declare(strict_types=1);
namespace App\Models;
final class Post extends Model
{
protected $fillable = ['title', 'slug', 'content', 'user_id'];
protected function casts(): array
{
return [
'status' => PostStatus::class,
'published_at' => 'datetime',
];
}
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
public function scopePublished(Builder $query): Builder
{
return $query->where('status', PostStatus::Published);
}
}
Query Optimization
// Eager loading (prevent N+1)
$posts = Post::with(['user', 'comments.user'])->get();
// Chunking for large datasets
User::chunk(100, function ($users) {
foreach ($users as $user) { }
});
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?