Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Profile Filament Plugin Laravel Package

rawilk/profile-filament-plugin

Filament plugin that jumpstarts a user profile area with multi-factor authentication, password and session management, migrations, and sensible defaults—opinionated but customizable. Designed to remove boilerplate and integrate cleanly into your panel.

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Steps

  1. Installation

    composer require rawilk/profile-filament-plugin
    php artisan vendor:publish --tag="profile-filament-migrations"
    php artisan vendor:publish --tag="profile-filament-config"
    php artisan migrate
    
  2. Register Plugin Add to your PanelProvider:

    use Rawilk\ProfileFilament\ProfileFilamentPlugin;
    
    public function panel(Panel $panel): Panel {
        return $panel->plugin(ProfileFilamentPlugin::make());
    }
    
  3. First Use Case Access /profile in your Filament admin panel to see the default profile page with basic user info, security settings, sessions, and account management.

Where to Look First


Implementation Patterns

Core Workflows

  1. Profile Customization Override default pages or components via plugin methods:

    ProfileFilamentPlugin::make()
        ->profileInfoPage(ProfileInfo::make()->title('Custom Profile'))
        ->securityPage(Security::make()->slug('security-settings'));
    
  2. Component Replacement Replace Livewire components in pages:

    ProfileInfo::make()->components([
        App\Livewire\CustomProfileForm::class,
    ]);
    
  3. Schema Customization Modify infolist schemas in a service provider:

    ProfileInfolist::configureComponents(fn () => [
        Section::make()->schema([TextEntry::make('custom_field')])
    ]);
    

Integration Tips

  • Authentication Integration Ensure your User model implements Filament\Contracts\HasAvatar and Filament\Contracts\HasProfilePhoto for profile photos.

  • MFA Setup Use the built-in MFA pages (TOTP, Recovery Codes) without additional setup:

    // Enable/disable MFA features in config/profile-filament.php
    'mfa' => [
        'enabled' => true,
        'providers' => ['totp', 'recovery_codes'],
    ]
    
  • Session Management Leverage the Sessions page for revoking active sessions:

    // Customize session table columns
    Sessions::make()->tableColumns([
        Tables\Columns\TextColumn::make('browser'),
        Tables\Columns\TextColumn::make('ip_address'),
    ]);
    
  • Account Deletion Extend the Settings page to add custom confirmation logic:

    Settings::make()->deleteAccountAction(
        DeleteAccountAction::make()->requiresConfirmation()
    );
    

Gotchas and Tips

Pitfalls

  1. Slug Conflicts

    • Always define custom slug() for pages to avoid Filament’s default default slug.
    • Example:
      Security::make()->slug('authentication'); // Avoids 'default' slug
      
  2. Navigation Group Issues

    • If using translated group labels, ensure the language key exists in your filament.php config under language.
    • Example:
      navigationGroup('profile.group.my_group', true)
      
  3. MFA Provider Dependencies

    • TOTP requires paragonie/googleauth:
      composer require paragonie/googleauth
      
    • Recovery codes require spatie/laravel-activitylog for audit trails (optional but recommended).
  4. Livewire Component Overrides

    • If replacing components, ensure your custom Livewire classes extend the base plugin components (e.g., extends \Rawilk\ProfileFilament\Livewire\Profile\ProfileInfo).

Debugging

  • Migration Conflicts If migrations fail, check for existing users or sessions tables. The plugin adds:

    • user_mfa_codes (for recovery codes)
    • user_sessions (extended session table)
  • Configuration Overrides Publish the config file to override defaults:

    php artisan vendor:publish --tag="profile-filament-config" --force
    
  • Livewire Component Debugging Use Filament’s --debug flag to inspect component rendering:

    php artisan filament:debug
    

Extension Points

  1. Custom Profile Fields Extend the ProfileInfolist or EditProfileForm schemas:

    ProfileInfolist::configureComponents(fn ($user) => [
        TextEntry::make('custom_field')->onlyWhen(fn () => $user->hasRole('admin')),
    ]);
    
  2. Event Listeners Listen for profile-related events (e.g., ProfileUpdated):

    use Rawilk\ProfileFilament\Events\ProfileUpdated;
    
    event(new ProfileUpdated($user, $data));
    
  3. API Endpoints Use Filament’s API resources to expose profile data:

    // In a Filament API resource
    public static function getPages(): array {
        return [
            'profile' => \Rawilk\ProfileFilament\Filament\Pages\Profile\ProfileInfo::class,
        ];
    }
    
  4. Testing Use the provided test helpers:

    use Rawilk\ProfileFilament\Testing\TestsProfileFilament;
    
    public function test_profile_page() {
        $this->actingAs($user)
              ->get('/profile')
              ->assertSuccessful();
    }
    

Pro Tips

  • Disable Features Toggle features in config/profile-filament.php:

    'features' => [
        'password_reset' => false,
        'email_verification' => true,
    ]
    
  • Dark Mode Support Ensure your custom components use Filament’s dark mode classes:

    <x-filament::section dark>
        <!-- Component content -->
    </x-filament::section>
    
  • Performance Lazy-load heavy components (e.g., session tables) with shouldBeLoaded():

    Sessions::make()->shouldBeLoaded(fn () => Auth::user()->hasPermission('view_sessions'));
    
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi