Laravel Best Practices
Ensures Laravel code adheres to best practices for security, performance, and maintainability based on asyrafhussin's expertise.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add laravel-best-practices npx -- -y @trustedskills/laravel-best-practices
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"laravel-best-practices": {
"command": "npx",
"args": [
"-y",
"@trustedskills/laravel-best-practices"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
This skill provides expert guidance on implementing Laravel best practices, including code structure, security measures, performance optimization, and maintainability. It helps developers write clean, efficient, and scalable PHP applications using the Laravel framework.
When to use it
- You're building a new Laravel application and want to follow industry-standard practices from the start.
- You need to refactor an existing Laravel project for better performance or readability.
- Your team is onboarding new developers who are unfamiliar with Laravel conventions.
- You're preparing for code reviews and want to ensure your implementation aligns with best practices.
Key capabilities
- Code organization using Laravel's directory structure conventions
- Security recommendations (e.g., CSRF protection, input validation)
- Performance optimization tips (e.g., caching, query optimization)
- Best practices for testing and debugging in Laravel
- Guidance on using Eloquent effectively
Example prompts
- "How should I organize my Laravel controllers and models?"
- "What are the best practices for securing a Laravel API endpoint?"
- "Can you explain how to optimize database queries in Laravel?"
Tips & gotchas
- Ensure your Laravel version is up-to-date, as best practices may vary between versions.
- Always validate user input and use Laravel's built-in security features like CSRF tokens and rate limiting.
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.