laravel

Generate Laravel 12.x applications and APIs with Eloquent ORM patterns.

Updated Oct 26, 2025
One-click install
npx skills add https://github.com/Hieubkav/wincellarCloneBackend --skill laravel-hieubkav
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel
Source: https://github.com/Hieubkav/wincellarCloneBackend/tree/main/.claude/skills/laravel/laravel
Command: npx skills add https://github.com/Hieubkav/wincellarCloneBackend --skill laravel-hieubkav

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and scripts (resource) components.

What problem does it solve?

This Skill consolidates Laravel backend guidelines, Eloquent ORM usage, routing, middleware, migrations, validation, and API design into actionable patterns to accelerate development while maintaining clean architecture and consistent conventions.

Core Features & Use Cases

  • Eloquent ORM usage patterns (relations, eager loading, scopes)
  • Routing, middleware, form validation, and API resource controllers
  • Service layer and repository patterns for business logic isolation
  • Migrations, seeds, queues, and event handling
  • Best practices for testing, error handling, and performance

Quick Start

Use Laravel patterns to structure a new API endpoint or feature, following the layered architecture and standard Laravel conventions.

Frequently Asked Questions about laravel

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

FAQPage Schema
How do I structure API endpoints and validation in Laravel?

Laravel provides routing, form requests, and API resources to structure endpoints. Define routes in web.php or api.php, use form request classes for validation, and return API resources to format responses consistently across your application.

What's the best way to organize business logic in Laravel applications?

Use service layer and repository patterns to isolate business logic from controllers. Services encapsulate domain rules, repositories abstract data access through Eloquent models, and this separation makes testing and maintenance simpler.

How do I set up authentication and authorization in Laravel APIs?

Laravel Sanctum and Passport handle API token authentication. Sanctum suits SPAs and mobile apps with token issuance, while Passport implements OAuth 2.0. Use policies for fine-grained authorization checks on resources.

Can I use Eloquent relationships and eager loading for performance?

Eloquent ORM supports hasMany, belongsTo, and many-to-many relationships. Eager load related data with with() to avoid N+1 queries, and define scopes on models to encapsulate reusable query logic.

How do I handle database changes and seed data in Laravel?

Migrations create and modify database schema with version control; run php artisan migrate. Seeders populate test or initial data; combine them in DatabaseSeeder for repeatable setup across environments.

What are common testing and error-handling patterns in Laravel?

Use PHPUnit for unit and feature tests. Validate input early in form requests, handle exceptions with custom error responses, log errors for debugging, and leverage Laravel's exception handler for consistent error formatting across your API.