mominalzaraa / filament-team-guard
Filament Team Guard — enhanced Laravel starter kit built with Filament. Team management, auth, 2FA, passkeys, API tokens. Inspired by Laravel Jetstream.
Fund package maintenance!
MominAlZaraa
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/mominalzaraa/filament-team-guard
Requires
- php: ^8.3|^8.4|^8.5
- bacon/bacon-qr-code: ^3.0
- filament/filament: ^5.0
- illuminate/contracts: ^12.0
- mobiledetect/mobiledetectlib: ^4.8
- njoguamos/laravel-turnstile: ^3.2
- pragmarx/google2fa: ^8.0
- spatie/laravel-package-tools: ^1.15.0
- spatie/laravel-passkeys: ^1.0
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.0
- nunomaduro/collision: ^8.0
- orchestra/testbench: ^10.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-arch: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
README
Requirements: PHP ^8.3 | ^8.4 | ^8.5 · Laravel ^12.0 · Filament ^5.0 (Livewire ^4.0, Tailwind ^4.0)
Enhanced Laravel starter kit built with Filament, inspired by Laravel Jetstream (discontinued). Brings team features, mature data handling, and Filament UI—auth, registration, 2FA, passkeys, session management, API tokens, teams. Skip boilerplate, start building.
Supported: PHP ^8.3–^8.5, Filament ^5.0, Laravel ^12.0, Livewire ^4.0, Tailwind ^4.0 · Deprecated: PHP <8.3, Filament v4 (use v1.x), Laravel <12.
Installation
composer require mominalzaraa/filament-team-guard php artisan filament-team-guard:install --teams --api
Omit --teams / --api if not needed. Action classes and email templates are published for customization.
Features
- Auth — Login, register, password reset, email verification
- Profile — Photo, info, password, sessions, delete account
- 2FA & passkeys — Embedded TOTP, recovery codes, Spatie Laravel Passkeys. Enable via
->twoFactorAuthentication(). - Cloudflare Turnstile — Optional
->turnstile()on auth + 2FA challenge/recovery. njoguamos/laravel-turnstile; setTURNSTILE_*in.env, runphp artisan turnstile:install. - Teams — Create, invite, roles, member management (add/remove/update role)
- API tokens — Optional Sanctum-style tokens
- i18n — Publishable locale-first language files
Enhanced vs stephenjude/filament-jetstream
- Publishable Action classes (Jetstream pattern):
UpdateUserProfileInformation,InviteTeamMember,AddTeamMember,RemoveTeamMember,UpdateTeamMemberRole,CreateTeam,UpdateTeamName,DeleteTeam,ValidateTeamDeletion,DeleteUser— all with contracts. - Email invitations — Registered/unregistered flow; “Create Account” when needed; session-based redirects; no auto-registration.
- Profile fields — Override
getFieldComponents(),getSectionHeading(),getSectionDescription()in published Action; add translations inlang/{locale}/filament-team-guard.php. - Team management — Custom
Rolerule,UpdateTeamMemberRole,RemoveTeamMember,ValidateTeamDeletion. - Publishable — Actions, emails, lang; locale-first translations with merge/override.
Customization
| What | Command |
|---|---|
| Action classes | php artisan vendor:publish --tag=filament-team-guard-actions |
| Language files | php artisan vendor:publish --tag=filament-team-guard-lang |
| Email templates | php artisan vendor:publish --tag=filament-team-guard-email-templates |
Profile field example: Publish actions + lang → add key in lang/en/filament-team-guard.php → in UpdateUserProfileInformation override getFieldComponents() and add a TextInput::make('surname') (and translation) → add surname to User $fillable.
Configuration (snippets)
Profile (2FA, passkeys, photo, etc.)
JetstreamPlugin::make() ->configureUserModel(userModel: User::class) ->profilePhoto(condition: fn() => true, disk: 'public') ->deleteAccount(condition: fn() => true) ->updatePassword(condition: fn() => true, Password::default()) ->profileInformation(condition: fn() => true) ->logoutBrowserSessions(condition: fn() => true) ->twoFactorAuthentication( condition: fn() => auth()->check(), forced: fn() => app()->isProduction(), enablePasskey: fn() => Feature::active('passkey'), requiresPassword: fn() => app()->isProduction(), );
Teams
JetstreamPlugin::make() ->teams(condition: fn() => Feature::active('teams'), acceptTeamInvitation: fn($id) => JetstreamPlugin::make()->defaultAcceptTeamInvitation()) ->configureTeamModels(teamModel: Team::class, roleModel: Role::class, membershipModel: Membership::class, teamInvitationModel: TeamInvitation::class);
API tokens
JetstreamPlugin::make()->apiTokens(condition: fn() => Feature::active('api'), permissions: fn() => ['create','read','update','delete'], menuItemLabel: fn() => 'API Tokens', menuItemIcon: fn() => 'heroicon-o-key');
Existing Laravel projects
- Profile:
php artisan vendor:publish --tag=filament-team-guard-migrations --tag=passkeys-migrations→ addInteractsWithProfile,HasProfilePhoto, implementHasAvatar&HasPasskeyson User; hide 2FA fields; appendprofile_photo_url. - Teams:
php artisan vendor:publish --tag=filament-team-guard-team-migration→ addInteractsWithTeams, implementHasTenantson User. - API: Same team migration tag → add
HasApiTokenson User.
Package development
Run composer install in the package root for tests. vendor/ is in .gitignore and not distributed; composer require mominalzaraa/filament-team-guard in an app only pulls package source—the app’s Composer resolves Filament once (no duplication). .gitattributes has /vendor export-ignore.
Testing · Changelog · Contributing
- Tests:
composer test - Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
Credits
- Laravel Jetstream (discontinued) — team features & Action pattern
- stephenjude/filament-jetstream — Filament port
- Momin Al Zaraa — this enhanced version · Issues · support@mominpert.com
License: MIT. See LICENSE.md.
