| Install | |
|---|---|
composer require filamerce/filament-user-profile |
|
| Latest Version: | v1.1.1 |
| PHP: | ^8.2 |
This package draws inspiration from Filament Breezy but does not include two-factor authentication (2FA) functionality.
Rather than offering multiple plugin options, this package provides a streamlined approach to extending and replacing components.
To install the package, execute the following command:
composer require filamerce/filament-user-panel
To register the plugin, use the following code snippet:
use Filamerce\FilamentUserProfile\UserProfilePlugin;
$panel->plugins([
UserProfilePlugin::make()
]);
Control whether the plugin should automatically register the user menu item:
UserProfilePlugin::make()
->registerUserMenu(false);
Replace the entire ProfilePage with your custom component:
UserProfilePlugin::make()
->profilePage(MyProfileComponent::class);
Manage the registered components and their order:
use Filamerce\FilamentUserProfile\Livewire\PersonalInfo;
use Filamerce\FilamentUserProfile\Livewire\UpdatePassword;
UserProfilePlugin::make()
->profileComponents([
'personal_info' => PersonalInfo::class,
'update_password' => UpdatePassword::class,
]);
Replace a specific profile component:
use My\Component\PersonalInfo;
UserProfilePlugin::make()
->replaceProfileComponent('personal_info', PersonalInfo::class);
Register a new profile component:
use My\Component\SomeComponent;
UserProfilePlugin::make()
->registerProfileComponent('some_component', SomeComponent::class);
Remove a specific profile component:
use My\Component\SomeComponent;
UserProfilePlugin::make()
->removeProfileComponent('personal_info');
Laravel Sanctum is automatically detected, and a component to manage Sanctum tokens is displayed in the profile. Control the available abilities with the following code:
UserProfilePlugin::make()
->sanctumAbilities(['read', 'write']);
By default, all tokens are registered with all abilities ([*]).
This package is compatible with stephenjude/filament-two-factor-authentication. Simply register the component as shown below:
UserProfilePlugin::make()
->registerProfileComponent('2fa', \Stephenjude\FilamentTwoFactorAuthentication\Livewire\TwoFactorAuthentication::class)