alessandronuunes/filament-member

Installs: 1

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/alessandronuunes/filament-member

v1.0.0 2026-01-28 19:04 UTC

This package is auto-updated.

Last update: 2026-01-28 19:25:03 UTC


README

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

Members Management Interface

Features

  • 🎯 Member Management: Easily manage members within your tenant/organization
  • 📧 Invitation System: Send invitations via email or shareable links
  • 🔐 Role-Based Access: Built-in support for roles (Owner, Admin, Member)
  • 🌐 Multi-language Support: Includes English and Portuguese (Brazil) translations
  • ⚙️ Highly Configurable: Customize models, tables, routes, and behavior
  • 📱 Responsive UI: Beautiful, modern interface built with Filament
  • 🔔 Notifications: Email notifications and in-app notifications for invitations
  • Validation: Prevents duplicate invitations and membership conflicts

Requirements

  • PHP 8.3 or higher
  • Laravel 11.x
  • Filament 4.0 or higher

Installation

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

Configuration

Register 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(),
        ]);
}

Customize Configuration

Edit config/filament-member.php to customize:

  • Models: Change the User, Tenant, and TenantInvite models
  • Tables: Customize database table names
  • Routes: Modify invitation acceptance routes
  • Invites: Configure default roles, expiration days, and behavior
  • Permissions: Set role-based permissions
  • Notifications: Configure email settings

Usage

Managing Members

Once installed, a "Members" page will be available in your Filament panel navigation. From there you can:

  1. Invite Members: Add up to 5 email addresses at once with assigned roles
  2. View Members: See all current members with their roles and join dates
  3. Manage Roles: Change member roles (Owner, Admin, Member)
  4. Remove Members: Remove members from the organization
  5. View Pending Invitations: See all pending invitations and resend or cancel them

Invitation Flow

  1. Send Invitation:

    • Individual invitations: Send to specific email addresses
    • Generic invitations: Generate a shareable link that anyone can use
  2. Accept Invitation:

    • New users: Create an account and automatically join
    • Existing users: Login and automatically accept the invitation
  3. Notifications:

    • Email notifications sent to invited users
    • In-app notifications for existing users

Roles

The plugin includes three default roles:

  • Owner: Full control, cannot be removed or have role changed
  • Admin: Can invite and remove members
  • Member: Basic access

You can customize these roles by modifying the TenantRole enum.

Customization

Custom Models

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,
],

Custom Roles

Modify the TenantRole enum to add or change roles:

enum TenantRole: string
{
    case Owner = 'owner';
    case Admin = 'admin';
    case Member = 'member';
    case Moderator = 'moderator'; // Add custom role
}

Custom Routes

Change the invitation acceptance route:

'routes' => [
    'invite_accept_path' => '/join/{token}',
    'invite_accept_name' => 'join.organization',
    'invite_accept_middleware' => ['signed', 'auth'],
],

Custom Views

Publish and customize the views:

php artisan vendor:publish --tag=filament-member-views

Translations

The plugin includes translations for:

  • English (en)
  • Portuguese - Brazil (pt_BR)

To add more languages, publish the translations and add your language files:

php artisan vendor:publish --tag=filament-member-translations

Translation files are located in resources/lang/{locale}/default.php.

Database Structure

The plugin creates three tables:

tenants

  • id
  • user_id (owner)
  • name
  • slug
  • status
  • invitation_token
  • timestamps

tenant_user (pivot table)

  • tenant_id
  • user_id
  • role
  • timestamps

tenant_invites

  • id
  • tenant_id
  • user_id (inviter)
  • email
  • token
  • role
  • expires_at
  • accepted_at
  • timestamps

Events

The plugin dispatches the following events:

  • TenantInviteCreated: Fired when a new invitation is created

Listeners

  • SendTenantInviteNotification: Sends email and in-app notifications
  • AcceptPendingInviteAfterLogin: Automatically accepts pending invitations after login

Validation Rules

  • AlreadyMember: Prevents inviting users who are already members

API

ConfigHelper

Use the ConfigHelper class to access configuration values:

use AlessandroNuunes\FilamentMember\Support\ConfigHelper;

$userModel = ConfigHelper::getUserModel();
$tenantModel = ConfigHelper::getTenantModel();
$defaultRole = ConfigHelper::getInviteConfig('default_role');

Permissions

Configure role-based permissions in config/filament-member.php:

'permissions' => [
    'roles' => [
        'can_invite_members' => ['owner', 'admin'],
        'can_remove_members' => ['owner', 'admin'],
        'can_change_roles' => ['owner'],
    ],
    'owner_cannot_be_removed' => true,
    'owner_cannot_change_role' => true,
],

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This package is open-sourced software licensed under the MIT license.

Author

Alessandro Nuunes

Support

For issues, questions, or contributions, please open an issue on the GitHub repository.

Repository