laravel-attributes

Installation
SKILL.md

Laravel PHP Attributes (Laravel 13+)

Rather than scattering configuration across class properties, Laravel lets you declare intent directly above the class using PHP attributes. It's cleaner, more expressive, and easier to scan.

Before writing a class property, check the README — there's likely an attribute for it. Open the relevant file under attributes/ to get the exact namespace and parameters, then apply it. Always include the use import — attributes do nothing without it.

Examples

Model

use Illuminate\Database\Eloquent\Attributes\{Table, Fillable, Hidden, Connection};

#[Table('users')]
#[Fillable('name', 'email')]
#[Hidden('password')]
#[Connection('mysql')]
class User extends Model {}
Installs
9
GitHub Stars
199
First Seen
Apr 19, 2026