laravel-expert

Provide expert Laravel patterns for efficient Eloquent queries and API design.

24|3|Updated Nov 25, 2025
One-click install
npx skills add https://github.com/nguyenthienthanh/aura-frog --skill laravel-expert
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-expert
Source: https://github.com/nguyenthienthanh/aura-frog/tree/main/aura-frog/skills/laravel-expert
Command: npx skills add https://github.com/nguyenthienthanh/aura-frog --skill laravel-expert

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill delivers expert Laravel/PHP backend patterns, promoting efficient Eloquent usage, clean service layers, and API-first design.

Core Features & Use Cases

  • Eloquent best practices: eager loading, selective columns, upserts, and transactions.
  • RESTful Controllers & DTOs: clean API boundaries.
  • Service patterns: transactional services and notification integration.
  • Validation & security: robust request validation.

Quick Start

Use the laravel-expert skill to design a Laravel API with efficient queries and solid service layer.

Frequently Asked Questions about laravel-expert

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent N+1 queries in Laravel Eloquent?

N+1 query problems occur when loading related models without eager loading. Use Eloquent's `with()` method to eager load relationships in a single query, specifying columns selectively to reduce data transfer and improve API response times.

What's the best way to structure a RESTful API in Laravel?

Build RESTful APIs using Laravel's resource controllers with clean separation of concerns. Combine controllers handling HTTP logic, DTOs for request/response shaping, and service layers encapsulating business logic to ensure maintainable, testable code.

How do I write efficient Eloquent queries?

Efficient Eloquent queries use eager loading, select specific columns instead of `select('*')`, leverage `firstOrCreate()` and upserts for atomic operations, and wrap related operations in transactions to prevent race conditions and maintain data integrity.

Can I use Artisan commands to automate Laravel backend tasks?

Yes. Artisan commands automate common backend operations like migrations, seeding, and custom tasks. Combine them with service layers and validation to build robust automation that enforces business logic and maintains code quality.

What validation patterns should I use for Laravel APIs?

Laravel's request validation framework enforces rules before data reaches your service layer. Validate input early, use custom rules for complex logic, and shape responses with DTOs to maintain clean API boundaries and prevent invalid data propagation.