tapp / filament-invite
invite users from filament panel
Fund package maintenance!
Tapp
Installs: 31 479
Dependents: 0
Suggesters: 0
Security: 0
Stars: 28
Watchers: 3
Forks: 6
pkg:composer/tapp/filament-invite
Requires
- php: ^8.2
- filament/filament: ^4.0
- spatie/laravel-package-tools: ^1.15.0
Requires (Dev)
- larastan/larastan: ^2.9||^3.0
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^10.0.0||^9.0.0
- pestphp/pest: ^3.0||^2.34
- pestphp/pest-plugin-arch: ^3.0||^2.7
- pestphp/pest-plugin-laravel: ^3.0||^2.3
- phpstan/extension-installer: ^1.3||^2.0
- phpstan/phpstan-deprecation-rules: ^1.1||^2.0
- phpstan/phpstan-phpunit: ^1.3||^2.0
- spatie/laravel-ray: ^1.35
- dev-main
- 2.x-dev
- v2.0.2
- v2.0.1
- v2.0.0
- v1.0.11
- v1.0.10
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- dev-dependabot/github_actions/stefanzweifel/git-auto-commit-action-7
- dev-dependabot/github_actions/actions/checkout-5
- dev-update_readme_filament4
- dev-filament4_upgrade
- dev-configurable-reset-route
This package is auto-updated.
Last update: 2025-10-27 19:51:18 UTC
README
Provides an action to invite users from Filament users resource.
Version Compatibility
| Filament | Filament Invite |
|---|---|
| 3.x | 1.x |
| 4.x | 2.x |
Installation
You can install the package via Composer:
For Filament 3
composer require tapp/filament-invite:"^1.0"
For Filament 4
composer require tapp/filament-invite:"^2.0"
Please check the docs for Filament 4 here
You can publish the config using:
php artisan filament-invite:install
Requirements
- User model which implements password resets and email verification (Laravel defaults)
Usage
Add invite action to a table
public static function table(Table $table): Table { return $table ->actions([ \Tapp\FilamentInvite\Tables\InviteAction::make(), ]); }
Invite action outside of a table uses a different class
protected function getHeaderActions(): array { return [ \Tapp\FilamentInvite\Actions\InviteAction::make(), ]; }
Notification Routing
The password reset URL can be customized or use the Filament's authentication system:
- Default: Uses Filament's built-in routing (respects panel's
passwordResetRouteSlugconfiguration) - Custom: Uses completely custom routes outside Filament's authentication system
// Get the appropriate panel $panel = $this->filamentPanelId ? Filament::getPanel($this->filamentPanelId) : Filament::getDefaultPanel(); if (empty(config('filament-invite.routes.reset'))) { // Use Filament's built-in routing (respects panel's passwordResetRouteSlug configuration) $url = $panel->getResetPasswordUrl($this->token, $notifiable, ['invite' => true]); } else { // Support both custom routes and full URLs for maximum flexibility $customRoute = config('filament-invite.routes.reset'); // Check if it's a full URL (starts with http/https) if (str_starts_with($customRoute, 'http')) { // Use the full URL directly $url = $customRoute . '?' . http_build_query([ 'token' => $this->token, 'email' => $email, 'invite' => true, ]); } else { // Use as route name - determine base URL based on configuration $routeUrl = route($customRoute, [ 'token' => $this->token, 'email' => $email, 'invite' => true, ], false); // Choose base URL: panel URL or app.url (for backward compatibility) $usePanelUrl = config('filament-invite.use_panel_url', false); $baseUrl = $usePanelUrl ? $panel->getUrl() : config('app.url'); $url = rtrim($baseUrl, '/') . '/' . ltrim($routeUrl, '/'); } }
Integration with Filament Panel Configuration
When using the default routing, the package automatically respects your panel's authentication configuration:
// In your panel configuration use Filament\Panel; public function panel(Panel $panel): Panel { return $panel ->passwordResetRouteSlug('custom-reset') // This will be used automatically ->passwordResetRequestRouteSlug('custom-request'); }
To use custom routing you have plenty of options:
Option 1: Custom Route Name
'routes' => [ 'reset' => 'your.custom.route.name', ],
Option 2: Full URL (External System)
'routes' => [ 'reset' => 'https://external-auth.example.com/reset-password', ],
Option 3: Different Domain/Subdomain
'routes' => [ 'reset' => 'https://auth.yourapp.com/password-reset', ],
The package automatically detects whether you're providing a route name or a full URL and handles the URL construction accordingly.
URL Base Configuration
For custom routes, you can choose between using the panel's URL or the application's URL:
// config/filament-invite.php return [ 'routes' => [ 'reset' => 'your.custom.route.name', ], // URL Configuration 'use_panel_url' => false, // Default: false (uses app.url for backward compatibility) ];
Options:
'use_panel_url' => false(default): Usesconfig('app.url')- maintains backward compatibility'use_panel_url' => true: Uses$panel->getUrl()
Customization
Reset URL
implement getResetPasswordUrl on the user model
public function getResetPasswordUrl(string $token, array $parameters = []): string { return URL::signedRoute( 'filament.admin.auth.password-reset.reset', [ 'email' => $this->email, 'token' => $token, ...$parameters, ], ); }
Notification
implement the sendPasswordSetNotification method on the user model
public function sendPasswordSetNotification($token) { Notification::send($this, new SetPassword($token)); }
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.