A comprehensive Filament plugin for managing tenant members, invitations, and role-based access control in multi-tenant applications.

Install the package via Composer:
composer require alessandronuunes/filament-member
Publish the configuration, migrations, and translations:
php artisan filament-member:install
Or publish them individually:
php artisan vendor:publish --tag=filament-member-config
php artisan vendor:publish --tag=filament-member-migrations
php artisan vendor:publish --tag=filament-member-translations
Run the migrations:
php artisan migrate
Then complete the setup by configuring your User model and registering the plugin.
Add the plugin to your Filament panel configuration:
use AlessandroNuunes\FilamentMember\MemberPlugin;
public function panel(Panel $panel): Panel
{
return $panel
->plugins([
MemberPlugin::make(),
]);
}
The plugin enables Filament tenancy on your panel. Filament will call getTenants(Panel $panel) on your User model to resolve which tenants the user can access. Your User model must implement this.
Add the HasTenantRelations trait and the HasTenants contract to your User model:
use Filament\Models\Contracts\FilamentUser;
use Filament\Models\Contracts\HasTenants;
use Filament\Panel;
use AlessandroNuunes\FilamentMember\Traits\HasTenantRelations;
use Illuminate\Support\Collection;
class User extends Authenticatable implements FilamentUser, HasTenants
{
use HasTenantRelations;
// ...
}
The trait provides:
getTenants(Panel $panel): Collection — tenants the user owns plus tenants they are a member ofcanAccessTenant(Model $tenant): bool — required by Filament for tenancytenants() — relationship for tenants owned by the usermemberTenants() — relationship for tenants where the user is a memberIf your app uses a different tenant model (e.g. Organization), set it in config/filament-member.php under models.tenant. The trait uses that configuration for relationships and table names.
Edit config/filament-member.php to customize:
Once installed, a "Members" page will be available in your Filament panel navigation. From there you can:
Send Invitation:
Accept Invitation:
Notifications:
The plugin includes three default roles:
You can customize these roles by modifying the TenantRole enum.
Update the model classes in config/filament-member.php:
'models' => [
'user' => App\Models\User::class,
'tenant' => App\Models\Organization::class,
'tenant_invite' => App\Models\Invitation::class,
],
Use your own role enum by setting it in config/filament-member.php:
'enums' => [
'tenant_role' => App\Enums\TenantRole::class,
],
Your enum should use string backing values (e.g. owner, admin, member) and implement Filament's HasLabel and HasColor for the admin UI. To add or change roles, define cases in your enum (e.g. case Moderator = 'moderator';).
Change the invitation acceptance route in config/filament-member.php:
'routes' => [
'invite_accept_path' => '/invite/{token}/accept',
'invite_accept_name' => 'invite.accept',
'invite_accept_middleware' => ['signed'],
],
If the theme file does not exist yet (e.g. resources/css/filament/admin/theme.css), create it by running:
php artisan make:filament-theme admin
You can specify your panel name if different. See the Filament documentation on creating a custom theme for details.
For the plugin styles to work correctly in your Filament panel, add the @source directive to your theme file (e.g. resources/css/filament/admin/theme.css):
@source '../../../../vendor/alessandronuunes/filament-member/resources/views/filament/**/*';
This ensures Tailwind scans the plugin's Blade views and generates the required CSS classes.
To override the plugin views, copy the Blade files from vendor/alessandronuunes/filament-member/resources/views to your project (e.g. resources/views/vendor/filament-member) and edit them. Your copies will take precedence over the package views.
The plugin includes translations for:
en)pt_BR)To add more languages, publish the translations and add your language files:
php artisan vendor:publish --tag=filament-member-translations
After publishing, translation files are located in lang/vendor/filament-member/{locale}/default.php.
The plugin creates three tables:
tenantsiduser_id (owner)namesluginvitation_token (nullable, for generic invite links)statustimestampstenant_user (pivot table)idtenant_iduser_idroletimestampstenant_invitesidtenant_iduser_id (inviter)emailtokenroleexpires_ataccepted_attimestampsThe plugin dispatches the following events:
TenantInviteCreated: Fired when a new invitation is createdSendTenantInviteNotification: Sends email and in-app notificationsAcceptPendingInviteAfterLogin: Automatically accepts pending invitations after loginAlreadyMember: Prevents inviting users who are already membersUse the ConfigHelper class to access configuration values:
use AlessandroNuunes\FilamentMember\Support\ConfigHelper;
$userModel = ConfigHelper::getUserModel();
$tenantModel = ConfigHelper::getTenantModel();
$defaultRole = ConfigHelper::getInviteConfig('default_role');
Contributions are welcome! Please feel free to submit a Pull Request.
This package is open-sourced software licensed under the MIT license.
Alessandro Nuunes
For issues, questions, or contributions, please open an issue on the GitHub repository.
How can I help you explore Laravel packages today?