All skills
asyrafhussin avatar

/laravel-database-optimization

@ac26821

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.

Use this Skill: https://skilld.dev/gh/asyrafhussin/agent-skills/laravel-database-optimization

This session only. Nothing lands on disk.

rules_template.md

≈453 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Rule Title Here

Impact: HIGH (optional impact description)

Brief explanation of the rule and why it matters for database performance in Laravel 13 applications. This should be clear and concise, explaining the performance implications and when this pattern applies. Focus on measurable improvements and real-world scenarios.

Incorrect

<?php

// Incorrect approach that causes performance issues
// Explain what makes this problematic
class BadExample
{
    public function index(): View
    {
        // This demonstrates the antipattern
        $posts = Post::all();

        foreach ($posts as $post) {
            echo $post->author->name; // N+1 query
        }
    }
}

Correct

<?php

// Optimized approach using Laravel 13 and PHP 8.3 patterns
class GoodExample
{
    public function index(): View
    {
        // This demonstrates the correct approach
        $posts = Post::with('author')->get();

        foreach ($posts as $post) {
            echo $post->author->name; // No additional queries
        }
    }
}

Additional context or variations (optional):

<?php

// Alternative patterns or edge cases
// Advanced usage examples
// Laravel 13 specific features

Problems

  • Problem 1: Specific issue with the incorrect approach
  • Problem 2: Performance or scalability concern
  • Problem 3: How it degrades under load

Benefits

  • Benefit 1: Specific performance improvement
  • Benefit 2: Scalability or reliability gain
  • Benefit 3: How it helps in production Laravel applications

Reference: Laravel 13 Documentation

Source: SKILL.md on GitHub

1 warning16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    This skill is a comprehensive documentation set for optimizing database performance in Laravel 13 applications. It provides best practices for Eloquent queries, indexing, Redis caching, and safe migrations. No malicious patterns, prompt injections, or data exfiltration attempts were detected.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer6mo

    6/39 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at ac26821. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 7 months ago
metadata
{
  "author": "agent-skills",
  "version": "1.1.1"
}

README badge

README badge for asyrafhussin/agent-skills/laravel-database-optimization