mominalzaraa/filament-team-guard 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mominalzaraa/filament-team-guard

Composer 安装命令:

composer require 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.

README 文档

README

Latest Version on Packagist Total Downloads GitHub Tests Code Style License PHP Version Sponsor

Filament Team Guard Banner

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; set TURNSTILE_* in .env, run php 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 in lang/{locale}/filament-team-guard.php.
  • Team management — Custom Role rule, 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 → add InteractsWithProfile, HasProfilePhoto, implement HasAvatar & HasPasskeys on User; hide 2FA fields; append profile_photo_url.
  • Teams: php artisan vendor:publish --tag=filament-team-guard-team-migration → add InteractsWithTeams, implement HasTenants on User.
  • API: Same team migration tag → add HasApiTokens on 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

Credits

License: MIT. See LICENSE.md.

统计信息

  • 总下载量: 385
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 0
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固