---
title: "Artisan commands — Teams for Laravel | Roundly"
description: "Eight commands list roles and permissions, resend and prune invites, report and prune memberships, expire join requests and scaffold policies."
url: https://roundly-consulting.com/open-source/docs/teams-for-laravel/commands
language: en
---

[All packages](https://roundly-consulting.com/open-source.md)

[Teams for Laravel](https://roundly-consulting.com/open-source/docs/teams-for-laravel.md)

# Artisan commands

```bash
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:

```php
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 crypto](https://roundly-consulting.com/support-us.md)

By donating, you agree to our [donation terms](https://roundly-consulting.com/donation-terms.md).

[Support our open source work (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Join us on Patreon (opens in a new tab)](https://www.patreon.com/cw/roundly)

## 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.

[Get a quote in 48 hours](https://roundly-consulting.com/contact.md) [Browse all packages](https://roundly-consulting.com/open-source/docs/teams-for-laravel.md)
