Skip to content
laravel logo

Laravel

laravel

Laravel v12 - The PHP Framework For Web Artisans

mattnigh/skills_collection1installs24stars

SKILL.md

Full skill instructions

When to Use This Skill

This skill should be triggered when:

  • Building Laravel applications or APIs
  • Working with Eloquent models, relationships, and queries
  • Setting up authentication, authorization, or API tokens
  • Creating database migrations, seeders, or factories
  • Implementing middleware, service providers, or events
  • Using Laravel's built-in features (queues, cache, validation, etc.)
  • Troubleshooting Laravel errors or performance issues
  • Following Laravel best practices and conventions
  • Implementing RESTful APIs with Laravel Sanctum or Passport
  • Working with Laravel Mix, Vite, or frontend assets

Reference Files

This skill includes comprehensive documentation in references/:

  • other.md - Laravel 12.x installation guide and core documentation

Use the reference files for detailed information about:

  • Installation and configuration
  • Framework architecture and concepts
  • Advanced features and packages
  • Deployment and optimization

Key Concepts

MVC Architecture

Laravel follows the Model-View-Controller pattern:

  • Models: Eloquent ORM classes representing database tables
  • Views: Blade templates for rendering HTML
  • Controllers: Handle HTTP requests and return responses

Eloquent ORM

Laravel's powerful database abstraction layer:

  • Active Record pattern: Each model instance represents a database row
  • Relationships: belongsTo, hasMany, belongsToMany, morphMany, etc.
  • Query Builder: Fluent interface for building SQL queries
  • Eager Loading: Prevent N+1 query problems with with()

Routing

Define application endpoints:

  • Route methods: get, post, put, patch, delete
  • Route parameters: Required {id} and optional {id?}
  • Route groups: Share middleware, prefixes, namespaces
  • Resource routes: Auto-generate RESTful routes

Middleware

Filter HTTP requests:

  • Built-in: auth, throttle, verified, signed
  • Custom: Create your own request/​response filters
  • Global: Apply to all routes
  • Route-specific: Apply to specific routes or groups

Service Container

Laravel's dependency injection container:

  • Automatic resolution: Type-hint dependencies in constructors
  • Binding: Register class implementations
  • Singletons: Share single instance across requests

Artisan Commands

Laravel's CLI tool:

php artisan make:model Post -mcr  # Create model, migration, controller, resource
php artisan migrate               # Run migrations
php artisan db:seed              # Seed database
php artisan queue:work           # Process queue jobs
php artisan optimize:clear       # Clear all caches

Working with This Skill

For Beginners

Start with:

  1. Installation: Set up Laravel using Composer
  2. Routing: Learn basic route definitions in routes/​web.php
  3. Controllers: Create controllers with php artisan make:controller
  4. Models: Understand Eloquent basics and relationships
  5. Migrations: Define database schema with migrations
  6. Blade Templates: Create views with Laravel's templating engine

For Intermediate Users

Focus on:

  • Form Requests: Validation and authorization in dedicated classes
  • API Resources: Transform models for JSON responses
  • Authentication: Implement with Laravel Breeze or Sanctum
  • Relationships: Master eager loading and complex relationships
  • Queues: Offload time-consuming tasks to background jobs
  • Events & Listeners: Decouple application logic

For Advanced Users

Explore:

  • Service Providers: Register application services
  • Custom Middleware: Create reusable request filters
  • Package Development: Build reusable Laravel packages
  • Testing: Write feature and unit tests with PHPUnit
  • Performance: Optimize queries, caching, and response times
  • Deployment: CI/​CD pipelines and production optimization

Navigation Tips

  • Check Quick Reference for common code patterns
  • Reference the official docs at https://laravel.com/docs/12.x
  • Use php artisan route:list to view all registered routes
  • Use php artisan tinker for interactive debugging
  • Enable query logging to debug database performance

Resources

Official Documentation

Community

Tools

  • Laravel Telescope: Debugging and monitoring
  • Laravel Horizon: Queue monitoring
  • Laravel Debugbar: Development debugging
  • Laravel IDE Helper: IDE autocompletion

Best Practices

  1. Use Form Requests: Separate validation logic from controllers
  2. Eager Load Relationships: Avoid N+1 query problems
  3. Use Resource Controllers: Follow RESTful conventions
  4. Type Hints: Leverage PHP type declarations for better IDE support
  5. Database Transactions: Wrap related database operations
  6. Queue Jobs: Offload slow operations to background workers
  7. Cache Queries: Cache expensive database queries
  8. API Resources: Transform data consistently for APIs
  9. Events: Decouple application logic with events and listeners
  10. Tests: Write tests for critical application logic

Notes

  • Laravel 12.x requires PHP 8.2 or higher
  • Uses Composer for dependency management
  • Includes Vite for asset compilation (replaces Laravel Mix)
  • Supports multiple database systems (MySQL, PostgreSQL, SQLite, SQL Server)
  • Built-in support for queues, cache, sessions, and file storage
  • Excellent ecosystem with first-party packages (Sanctum, Horizon, Telescope, etc.)

References

Quick Reference: read .claude/​skills/​laravel/​references/​quick-reference.md Common Patterns: read .claude/​skills/​laravel/​references/​common-patterns.md

More skills from mattnigh

TypeScript厳格モードによる型安全性設計を専門とするスキル。 📖 参照書籍: - 『Effective TypeScript』(Dan Vanderkam): 型設計 📚 リソース参照: - `resources/Level1_basics.md`: レベル1の基礎ガイド - `resources/Level2_intermediate.md`: レベル2の実務ガイド - `resources/Level3_advanced.md`: レベル3の応用ガイド - `resources/Level4_expert.md`: レベル4の専門ガイド - `resources/di...

24 0
View
deploying-cloud-k8s logo
mattnigh/skills_collection

deploying-cloud-k8s

Deploys applications to cloud Kubernetes (AKS/GKE/DOKS) with CI/CD pipelines. Use when deploying to production, setting up GitHub Actions, troubleshooting deployments. Covers build-time vs runtime vars, architecture matching, and battle-tested debugging.

24 0
View
moai-alfred-agent-guide logo
mattnigh/skills_collection

moai-alfred-agent-guide

19-agent team structure, decision trees for agent selection, Haiku vs Sonnet model selection, and agent collaboration principles. Use when deciding which sub-agent to invoke, understanding team responsibilities, or learning multi-agent orchestration.

24 0
View
mermaid-diagram-generator logo
mattnigh/skills_collection

mermaid-diagram-generator

Converts architecture descriptions, module specs, or workflow docs into Mermaid diagrams. Use when visualizing brick module relationships, workflows (DDD, investigation), or system architecture. Supports: flowcharts, sequence diagrams, class diagrams, state machines, entity relationship diagrams,...

24 0
View
pre-flight-check logo
mattnigh/skills_collection

pre-flight-check

INVOKE FIRST before any code work. Validates git workflow (branch, issue, worklog) and checks approach. Use at START of every task and END before completing. Prevents skipped steps.

24 0
View
browser-dev-tools logo
mattnigh/skills_collection

browser-dev-tools

This skill should be used when working with browser-rendered artifacts (i.e. Bun, React/React Native) to proactively validate that development work on localhost is being built appropriately and to support debugging browser-rendered content. Use this skill after making frontend changes to verify t...

24 0
View
lead-dev logo
mattnigh/skills_collection

lead-dev

Lead Développeur - Coordination technique opérationnelle, code review, mentoring et livraison. Pair de web-dev-process au niveau OPÉRATIONS.

24 0
View
worker-monitor logo
mattnigh/skills_collection

worker-monitor

Monitor Docker workers, RQ queue health, and auto-scale workers (max 4). Use when: checking job progress, monitoring queue depth, scaling workers up/down, diagnosing slow processing, or waiting for jobs to complete. Referenced by data-quality skill during reprocessing.

24 0
View
quality-advisor logo
mattnigh/skills_collection

quality-advisor

Proactive quality guidance system that monitors artifact creation and provides real-time feedback on documentation quality

24 0
View
bump-version logo
mattnigh/skills_collection

bump-version

This skill should be used when the user wants to bump the version number in the workspace. It updates versions across all pyproject.toml files (root, tde, and tda packages) and the CHANGELOG.md to keep them synchronized.

24 0
View
check-code-quality logo
mattnigh/skills_collection

check-code-quality

Run comprehensive Rust code quality checks including compilation, linting, documentation, and tests. Use after completing code changes and before creating commits.

24 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View