alfasix / alfakit-teams
Jetstream-style teams for AlfaKit panels on top of multi-tenancy: team creation and settings, personal teams, members with configurable roles and permissions, email invitations, domain auto-join, seat limits and an optional billing seat hook.
Requires
- php: ^8.4
- alfasix/alfakit: ^0.1|@dev
Requires (Dev)
None
Suggests
- alfasix/alfakit-billing: Per-team subscriptions: derive seats from the plan and sync the subscription quantity.
- alfasix/alfakit-shield: Mirror team roles to spatie/laravel-permission roles scoped to the team.
Provides
None
Conflicts
None
Replaces
None
README
by Alfa Six
This is a read-only split of the AlfaKit monorepo. Please open issues and pull requests there.
Jetstream-style teams for AlfaKit panels, built on AlfaKit's multi-tenancy: create team and team settings pages, personal teams, members with configurable roles and permissions, e-mail invitations with signed links, domain auto-join, seat limits and an optional seat hook for the AlfaKit billing plugin. It renders in React, Vue and Svelte with AlfaKit's built-in components.
Installation
composer require alfasix/alfakit-teams php artisan vendor:publish --tag=alfakit-teams-migrations php artisan migrate
Usage
use AlfaSix\Alfakit\Contracts\HasDefaultTenant; use AlfaSix\Alfakit\Contracts\HasTenants; use AlfaSix\AlfakitTeams\Concerns\HasTeams; class User extends Authenticatable implements HasDefaultTenant, HasTenants { use HasTeams; }
use AlfaSix\AlfakitTeams\Permission; use AlfaSix\AlfakitTeams\Role; use AlfaSix\AlfakitTeams\TeamsPlugin; $panel ->login() ->registration() ->plugin( TeamsPlugin::make() ->personalTeams() ->roles([ Role::make('owner'), Role::make('admin')->permissions([Permission::UPDATE_TEAM, 'members:*']), Role::make('member')->permissions(['projects:create']), ]) ->seats(fn ($team) => 10) ->domainAutoJoin(), );
Invitations are queued mail notifications: run a queue worker.
Read the full documentation at alfakit.dev/docs/plugins/teams.
License
MIT. See LICENSE.md.