laravel-attributes
БесплатноБез исполняемых скриптовНе проверенUse when migrating Eloquent models, Jobs, Console commands, Controllers, API Resources, Validation, Factories or Seeders to Laravel 13 PHP attributes.
от Fusengine★ 36 звёзд на GitHubОб этом скилле
Laravel 13 PHP Attributes
Agent Workflow (MANDATORY)
Before ANY implementation, spawn 3 agents in parallel, one Agent call each with a name:
- fuse-ai-pilot:explore-codebase - Scan existing models/jobs/controllers for legacy
protected $fillable / $hidden / $connectionproperties to convert - fuse-ai-pilot:research-expert - Verify Laravel 13 release notes for attribute coverage and edge cases
- mcp__context7__query-docs - Pull authoritative examples from
laravel.com/docs/13.x
After implementation, run fuse-ai-pilot:sniper for validation.
Overview
| Category | Attributes |
|---|---|
| Eloquent | #[Table] #[Connection] #[Fillable] #[Hidden] #[Visible] #[Guarded] #[Unguarded] #[Appends] #[Touches] #[WithoutTimestamps] #[WithoutIncrementing] #[DateFormat] #[Refreshes] (13.33+) — no #[Casts] (use casts()) |
| Queue / Job | #[Connection] #[Queue] #[Tries] #[Timeout] #[Backoff] #[MaxExceptions] #[FailOnTimeout] #[UniqueFor] #[DeleteWhenMissingModels] #[Delay] (13.4+) #[DebounceFor] (13.6+) |
| Console | #[Signature] #[Description] |
| Controllers | #[Middleware] #[Authorize] #[WithoutMiddleware] (13.20+) — namespace Illuminate\Routing\Attributes\Controllers |
| Validation | #[RedirectTo] #[RedirectToRoute] #[ErrorBag] #[StopOnFirstFailure] #[FailOnUnknownFields] — namespace Illuminate\Foundation\Http\Attributes |
| API Resources | #[Collects] #[PreserveKeys] |
| Factories / Testing | #[UseModel] (factories) · #[Seed] #[Seeder] #[UnitTest] (test classes, Illuminate\Foundation\Testing\Attributes) |
| Container | #[BindWhen] (13.22+, PHP 8.5) and the contextual attributes (#[Config], #[Auth], ...) |
Critical Rules
- NEVER mix attributes and legacy properties -
#[Fillable(['name'])]+protected $fillable = [...]causes Laravel to ignore the attribute silently - Class-level for Eloquent / Job - Eloquent and queue attributes apply to the class; controller
#[Middleware]/#[Authorize]also work on public action methods - Single source of truth - Choose attributes OR properties per class; refactor in one pass to avoid drift
- Inheritance is additive - Child class attributes merge with parent attributes; redeclare to override
- Import the right namespace -
Illuminate\Database\Eloquent\Attributes\*for Eloquent,Illuminate\Queue\Attributes\*for Jobs
Architecture
app/
├── Models/
│ └── User.php # #[Table] #[Fillable] #[Hidden] #[Appends]
├── Jobs/
│ └── ProcessPodcast.php # #[Connection] #[Queue] #[Tries] #[Backoff]
├── Console/Commands/
│ └── SendEmails.php # #[Signature] #[Description]
├── Http/
│ ├── Controllers/
│ │ └── PostController.php # #[Middleware] #[Authorize]
│ └── Resources/
│ └── PostCollection.php # #[Collects] #[PreserveKeys]
└── Http/Requests/
└── StoreUserRequest.php # #[RedirectTo] #[StopOnFirstFailure]
→ See Model-with-attributes.php.md for full example
Reference Guide
| Topic | Reference | When to Consult |
|---|---|---|
| Eloquent models | eloquent.md | Migrating $fillable / $hidden / $table / $connection |
| Queue jobs | queue.md | Replacing $tries / $timeout / $backoff properties |
| Console commands | console.md | Refactoring $signature / $description properties |
| Controllers | controllers.md | Moving middleware/authorize from constructors |
| Validation | validation.md | FormRequest redirect + early-stop config |
| API Resources | api-resources.md | Collection wrapping and key preservation |
| Factories / Seeders | factories-seeders.md | Factory model binding and test seeding |
Templates
| Template | When to Use |
|---|---|
| Model-with-attributes.php.md | Net new Eloquent model |
| Job-with-attributes.php.md | Net new queue Job |
Quick Reference
Eloquent model
Установить laravel-attributes в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл laravel-attributes?
Use when migrating Eloquent models, Jobs, Console commands, Controllers, API Resources, Validation, Factories or Seeders to Laravel 13 PHP attributes.
Как установить скилл laravel-attributes?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл laravel-attributes запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic