Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Laravel Attributes

ASecurity

Use when migrating Eloquent models, Jobs, Console commands, Controllers, API Resources, Validation, Factories or Seeders to Laravel 13 PHP attributes.

29 stars
0 votes
0 copies
0 views
Added 5/28/2026
ai-agentsrustgophptestingrefactoringapidatabase

Works with

apimcp

Security Analysis

A100/100

Pro scans all 10 files and shows the line behind each finding

Scanned 9/29/2026

$npx -y skills add fusengine/agents --skill laravel-attributes --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Laravel Attributes?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Laravel Attributes
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/fusengine-laravel-attributes/badge)](https://www.skillsdirectory.com/skills/fusengine-laravel-attributes)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: laravel-attributes
description: Use when migrating Eloquent models, Jobs, Console commands, Controllers, API Resources, Validation, Factories or Seeders to Laravel 13 PHP attributes.
versions:
  laravel: "13.0"
  php: "8.3"
user-invocable: true
references: references/eloquent.md, references/queue.md, references/console.md, references/controllers.md, references/validation.md, references/api-resources.md, references/factories-seeders.md, references/templates/Model-with-attributes.php.md, references/templates/Job-with-attributes.php.md
related-skills: laravel-eloquent, laravel-queues, laravel-api
---

<objective>
Covers all 7 categories of Laravel 13 first-party PHP 8.3 attributes that
replace legacy class properties: Eloquent (#[Table], #[Fillable], #[Hidden],
#[Guarded], #[Appends], #[Touches], #[Connection]), Queue/Job (#[Connection],
#[Queue], #[Tries], #[Timeout], #[Backoff], #[MaxExceptions],
#[FailOnTimeout], #[UniqueFor]), Console (#[Signature], #[Description]),
Controllers (#[Middleware], #[Authorize]), Validation (#[RedirectTo],
#[StopOnFirstFailure]), API Resources (#[Collects], #[PreserveKeys]), and
Factories/Test seeding (#[UseModel], #[Seed], #[Seeder]).
</objective>

# Laravel 13 PHP Attributes

## Agent Workflow (MANDATORY)

Before ANY implementation, spawn 3 agents in parallel, one `Agent` call each with a `name`:

1. **fuse-ai-pilot:explore-codebase** - Scan existing models/jobs/controllers for legacy `protected $fillable / $hidden / $connection` properties to convert
2. **fuse-ai-pilot:research-expert** - Verify Laravel 13 release notes for attribute coverage and edge cases
3. **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

1. **NEVER mix attributes and legacy properties** - `#[Fillable(['name'])]` + `protected $fillable = [...]` causes Laravel to ignore the attribute silently
2. **Class-level for Eloquent / Job** - Eloquent and queue attributes apply to the class; controller `#[Middleware]` / `#[Authorize]` also work on public action methods
3. **Single source of truth** - Choose attributes OR properties per class; refactor in one pass to avoid drift
4. **Inheritance is additive** - Child class attributes merge with parent attributes; redeclare to override
5. **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](references/templates/Model-with-attributes.php.md) for full example

---

## Reference Guide

| Topic | Reference | When to Consult |
|-------|-----------|-----------------|
| **Eloquent models** | [eloquent.md](references/eloquent.md) | Migrating `$fillable / $hidden / $table / $connection` |
| **Queue jobs** | [queue.md](references/queue.md) | Replacing `$tries / $timeout / $backoff` properties |
| **Console commands** | [console.md](references/console.md) | Refactoring `$signature / $description` properties |
| **Controllers** | [controllers.md](references/controllers.md) | Moving middleware/authorize from constructors |
| **Validation** | [validation.md](references/validation.md) | FormRequest redirect + early-stop config |
| **API Resources** | [api-resources.md](references/api-resources.md) | Collection wrapping and key preservation |
| **Factories / Seeders** | [factories-seeders.md](references/factories-seeders.md) | Factory model binding and test seeding |

### Templates

| Template | When to Use |
|----------|-------------|
| [Model-with-attributes.php.md](references/templates/Model-with-attributes.php.md) | Net new Eloquent model |
| [Job-with-attributes.php.md](references/templates/Job-with-attributes.php.md) | Net new queue Job |

---

## Quick Reference

### Eloquent model

```php
use Illuminate\Database\Eloquent\Attributes\{Table, Fillable, Hidden, Appends};

#[Table('flights')]
#[Fillable(['name', 'origin'])]
#[Hidden(['password'])]
#[Appends(['is_admin'])]
class Flight extends Model {}
```

### Queue job

```php
use Illuminate\Queue\Attributes\{Connection, Queue, Tries, Backoff};

#[Connection('redis')]
#[Queue('podcasts')]
#[Tries(5)]
#[Backoff([10, 30, 60])]
class ProcessPodcast implements ShouldQueue {}
```

→ See [Job-with-attributes.php.md](references/templates/Job-with-attributes.php.md) for complete example

---

## Best Practices

### DO
- Convert one class at a time and run tests between commits
- Keep attribute imports grouped at the top via PHP 8.1 grouped `use` syntax
- Use `#[Fillable]` for mass-assigned models and `#[Unguarded]` only on trusted internal models
- Combine `#[Connection]` + `#[Queue]` on Jobs to centralize routing intent

### DON'T
- Don't mix `#[Fillable(['x'])]` with `protected $fillable = ['y']` - the property silently wins on some setups, the attribute on others
- Don't place Eloquent/Job attributes on methods - they target the class only
- Don't put `#[Authorize]` on a controller action without an underlying Policy (auto-discovered, `Gate::policy()` in `AppServiceProvider`, or `#[UsePolicy]` on the model)
- Don't forget to drop the legacy `$tries`, `$backoff`, `$timeout` properties after adding the attributes - duplication is a red flag for code review

Attribution

fusenginefusengine
View sourceSee grades on GitHubMore from fusengine →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698461 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →