laravel-expert

Generates and reviews idiomatic Laravel code following clean architecture and security practices.

Updated Nov 29, 2025
One-click install
npx skills add https://github.com/achyutkneupane/Blog-Kit --skill laravel-expert-achyutkneupane
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-expert
Source: https://github.com/achyutkneupane/Blog-Kit/tree/main/.ai/skills/laravel-expert
Command: npx skills add https://github.com/achyutkneupane/Blog-Kit --skill laravel-expert-achyutkneupane

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing Laravel code that is maintainable, secure, and idiomatic requires deep framework knowledge, and developers often end up with fat controllers, N+1 queries, or inconsistent validation patterns that create technical debt. ## Core Features & Use Cases - Feature Development Guidance: Produces Laravel code following clean architecture with thin controllers, service classes, FormRequests, and API Resources. - Code Review & Refactoring: Identifies anti-patterns like blind mass assignment, missing eager loading, and business logic in routes, then provides refactored versions. - Use Case: When building a new REST API endpoint in Laravel 11, use this Skill to generate the complete structure including route model binding, FormRequest validation, an API Resource response, and policy-based authorization. ## Quick Start Ask the assistant to design a Laravel API endpoint for managing blog posts with validation, authorization, and proper JSON responses.

Frequently Asked Questions about laravel-expert

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

FAQPage Schema
How do I structure a Laravel API endpoint correctly?

Structure a Laravel API endpoint with route model binding, a FormRequest class for validation, a thin controller delegating to a service, and an API Resource for the JSON response. Apply policies for authorization and return proper HTTP status codes with pagination for collections.

How to avoid N+1 query problems in Laravel Eloquent?

Avoid N+1 queries in Eloquent by using eager loading with the with() method when fetching related models. Use query scopes for reusable filters and load relationships upfront rather than accessing them lazily inside loops.

Should I use Sanctum or Passport for Laravel API authentication?

Use Sanctum for SPA and API token authentication in most Laravel applications, as it is lightweight and Laravel-native. Passport is only needed when you require full OAuth2 server capabilities for third-party client integrations.

When should I not use this Laravel expert skill?

Do not use this skill for non-Laravel PHP projects, framework-agnostic PHP tasks, or non-PHP solutions. It is scoped specifically to Laravel 10/11+ backend engineering and assumes a Laravel application context.

What are common Laravel anti-patterns to avoid?

Common Laravel anti-patterns include fat controllers, business logic in routes, blind mass assignment with request()->all(), raw queries without necessity, and hardcoded configuration values. Move logic into services, use FormRequests, and leverage Eloquent conventions instead.