- Home
- Skills
- Jcastillotx
- Vibe Skeleton App
- Laravel Best Practices
laravel-best-practices_skill
- JavaScript
0
GitHub Stars
4
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill jcastillotx/vibe-skeleton-app --skill laravel-best-practices- metadata.json575 B
- package.json539 B
- README.md1.6 KB
- SKILL.md1.4 KB
Overview
This skill codifies Laravel development standards focused on security, Eloquent optimization, performance, architecture, API design, testing, queues, and Livewire patterns. It organizes 26 practical rules across eight categories to guide safe, efficient, and maintainable Laravel apps. Use it as a checklist and reference when building or reviewing Laravel projects.
How this skill works
The skill inspects common Laravel development areas and recommends concrete practices: prevent CSRF/XSS/SQL injection, guard against mass assignment, optimize Eloquent with eager loading and chunking, and enable caching and OPcache for production. It also covers architecture choices (service containers, actions), API conventions (resources, rate limiting), testing strategies, job/queue handling, and Livewire optimizations.
When to use it
- During application design or architecture reviews for new Laravel projects
- When optimizing slow Eloquent queries or reducing N+1 query problems
- While hardening an app for security and production readiness
- When implementing or versioning REST APIs and rate limiting
- While creating job queues, retries, and batching strategies
- When developing Livewire components to avoid unnecessary re-renders
Best practices
- Always escape output and use Blade/validation helpers to prevent XSS and CSRF issues
- Protect models with fillable/guarded to prevent mass assignment vulnerabilities
- Eager load relationships, use chunking or lazy collections for large datasets
- Enable route/config caching and OPcache in production for performance
- Favor small, single-responsibility actions/services and use the service container for dependencies
- Use API Resources, version endpoints, and apply rate limiting for public APIs
Example use cases
- Audit controllers and models to fix N+1 queries and add eager loads
- Harden form handling by ensuring CSRF tokens and input sanitization are in place
- Migrate a monolith feature into an action or service for clearer responsibilities
- Implement job batching with retries and backoff for heavy background processing
- Structure API endpoints with resources, versioning, and throttle rules
- Optimize Livewire components with wire:loading, lazy properties, and pagination
FAQ
The principles are broadly applicable, but check framework-specific features and available helpers for your Laravel version before applying changes.
Which category should I prioritize for a production launch?
Prioritize Security and Eloquent Optimization first, then Performance and Architecture to ensure safety and responsiveness at scale.