PHP code example of mominalzaraa / filament-team-guard

1. Go to this page and download the library: Download mominalzaraa/filament-team-guard library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mominalzaraa / filament-team-guard example snippets


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'),
        

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);

JetstreamPlugin::make()->apiTokens(condition: fn() => Feature::active('api'), permissions: fn() => ['create','read','update','delete'], menuItemLabel: fn() => 'API Tokens', menuItemIcon: fn() => 'heroicon-o-key');