Artisan commands
php artisan teams:roles # list registered/persisted roles and permissions
php artisan teams:permissions # list registered permissions and their groups
php artisan teams:invites:prune # delete invites that expired over a month ago
php artisan teams:invites:resend {code} # rotate an invite's code and extend its expiry
php artisan teams:members:prune # delete members expired beyond the retention window
php artisan teams:members:expiring # report memberships expiring soon (--days, --notify)
php artisan teams:join-requests:prune # auto-decline pending requests past their expiry
php artisan teams:policy {name} # scaffold a team-scoped policy (--force to overwrite)| Command | Options | Output |
|---|---|---|
teams:roles | — | Table: Key | Name | Permissions. |
teams:permissions | — | Table: Key | Name | Group. |
teams:invites:prune | — | Count of invites pruned. |
teams:invites:resend {code} | — | The new code; fails for an unknown code. |
teams:members:prune | — | Count pruned; fires MembershipExpired per row. |
teams:members:expiring | --days= --notify | Table: Team | Member | Role | Expires at | In. |
teams:join-requests:prune | — | Count auto-declined; fires JoinRequestExpired per row. |
teams:policy {name} | --force | Writes app/Policies/<Name>.php. |
Scheduling
The prune and expiry commands are built for the scheduler:
use Illuminate\Support\Facades\Schedule;
// routes/console.php
Schedule::command('teams:invites:prune')->daily();
Schedule::command('teams:members:prune')->daily();
Schedule::command('teams:join-requests:prune')->hourly();
Schedule::command('teams:members:expiring --notify')->daily();Invite, Member and JoinRequest are also Prunable, so php artisan model:prune complements these: it prunes the same expired memberships (firing MembershipExpired too), additionally reaches revoked and consumed invites, and hard-deletes long-resolved join requests. Auto-declining expired pending requests — and JoinRequestExpired — is teams:join-requests:prune’s job alone.
php artisan about
The package adds a Teams section to php artisan about: the configured models, role driver, role and permission counts, per-team roles, role cache, invite, member and join-request lifecycle, approvals and Gate status. It never prints role keys, permissions, the ability prefix, cache stores or queue connections.
Show 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.