Artisan commands
# List the attributes attached to an owner record:
php artisan attributes:list "App\Models\Product" 42
# Permanently delete soft-deleted attributes older than N days (default from config):
php artisan attributes:prune --days=30 --forceattributes:list
Prints a Name / Type / Value / Meta table for one owner record, sorted by name. The first argument is the owner type as stored in owner_type — the class name, or its alias if you use a morph map:
# With a morph map, pass the alias stored in owner_type:
php artisan attributes:list product 42attributes:prune
Permanently deletes soft-deleted attributes whose deleted_at is older than --days (default: prune_after_days, 30). It asks for confirmation unless you pass --force, then runs Attributes::prune($days) — so schedule it with --force, or schedule the facade call directly. --days must be a whole number (0 or more); anything else fails the command instead of being read as 0 and purging every trashed attribute:
// routes/console.php
use Illuminate\Support\Facades\Schedule;
use RoundlyConsulting\Attributes\Facades\Attributes;
Schedule::command('attributes:prune --force')->daily();
// ...or call what the command runs
Schedule::call(fn () => Attributes::prune())->daily();about
The package reports its configuration to Laravel’s about command — model, table, strict mode, history, prune age and the number of definitions (and how many are encrypted). Definition names are never printed:
php artisan about --only=attributesShow your open-source love
This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.
More ways to support, including cryptoBy donating, you agree to our donation terms.
Want this built into your product?
We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.