wirement/wirement-profile 问题修复 & 功能扩展

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

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

wirement/wirement-profile

Composer 安装命令:

composer require wirement/wirement-profile

包简介

A comprehensive Laravel profile management package with two-factor authentication for Filament panels.

README 文档

README

A modern Filament v4 package for profile management with built-in two-factor authentication, passkey support, and team management for Filament panels.

Latest Version on Packagist Total Downloads

Wirement Profile provides a complete profile management solution with advanced security features, all implemented with native Filament panels and components following Wirement design standards.

Features:

  • 🔐 Two-Factor Authentication - Built-in Google 2FA with QR codes and recovery codes
  • 🔑 Passkey Authentication - Modern passwordless authentication using WebAuthn
  • 👤 Profile Management - Complete user profile with photo uploads
  • 👥 Team Management - Optional team collaboration features
  • 🔗 API Token Management - Secure API access tokens
  • 🎨 Modern UI - Beautiful, Apple-inspired design following Wirement standards

Requirements

  • PHP 8.2+
  • Laravel v11.28+
  • Filament v4.0+
  • Tailwind CSS v4.0+ (if using custom themes)

Installation

You can install the package via composer:

composer require wirement/wirement-profile

You can publish and run the migrations with:

php artisan vendor:publish --tag="wirement-profile-migrations"
php artisan migrate

You can publish the config file with:

php artisan vendor:publish --tag="wirement-profile-config"

Optionally, you can publish the views using:

php artisan vendor:publish --tag="wirement-profile-views"

Or use the install command to set everything up:

php artisan wirement-profile:install

Tailwind CSS v4 Setup

This package uses Tailwind CSS v4 with its native configuration approach (no config file needed):

  1. Install Tailwind CSS v4:
npm install tailwindcss@next
  1. Import the package styles in your main CSS file:
@import "tailwindcss";
@import "../vendor/wirement/wirement-profile/resources/css/app.css";
  1. Build your assets:
npx tailwindcss -i resources/css/app.css -o public/css/app.css

Or add to your package.json scripts:

{
  "scripts": {
    "build": "tailwindcss -i resources/css/app.css -o public/css/app.css",
    "dev": "tailwindcss -i resources/css/app.css -o public/css/app.css --watch"
  }
}

Setup

1. Update your User model

Add the HasTwoFactorAuthentication trait to your User model:

<?php

namespace App\Models;

use Illuminate\Foundation\Auth\User as Authenticatable;
use Wirement\Profile\Traits\HasTwoFactorAuthentication;

class User extends Authenticatable
{
    use HasTwoFactorAuthentication;
    
    // ... rest of your model
}

2. Add the plugin to your Filament panel

<?php

namespace App\Providers\Filament;

use Filament\Panel;
use Filament\PanelProvider;
use Wirement\Profile\WirementProfilePlugin;

class AdminPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            ->plugins([
                WirementProfilePlugin::make()
                    ->enableTwoFactorAuthentication()
                    ->enablePasskeyAuthentication()
                    ->addTwoFactorMenuItem()
                    ->forceTwoFactorSetup(false), // Set to true to force 2FA setup
            ]);
    }
}

3. Run migrations

php artisan migrate

Configuration

The package publishes a configuration file to config/wirement-profile.php where you can customize:

  • Two-factor authentication settings
  • Passkey configuration
  • Profile features (photos, API tokens, teams, etc.)
  • UI theme and layout settings
return [
    'enable_two_factor_authentication' => true,
    
    'two_factor' => [
        'google_2fa' => ['enabled' => true],
        'passkey' => ['enabled' => true],
        'show_menu_item' => true,
        'force_setup' => false,
    ],
    
    'features' => [
        'profile_photos' => true,
        'api_tokens' => true,
        'teams' => false,
        'account_deletion' => true,
    ],
    
    'ui' => [
        'theme' => [
            'primary_color' => 'indigo',
        ],
    ],
];

Usage

Two-Factor Authentication

Users can enable 2FA from their profile page. The package provides:

  • Google Authenticator integration with QR codes
  • Recovery codes for backup access
  • Passkey support for modern passwordless authentication

Accessing Plugin Features

You can access plugin features programmatically:

use Wirement\Profile\WirementProfile;

// Get the plugin instance
$plugin = WirementProfile::plugin();

// Check if features are enabled
if ($plugin->hasTeamsFeatures()) {
    // Team functionality is available
}

if ($plugin->hasTwoFactorAuthenticationFeatures()) {
    // 2FA functionality is available
}

Custom Profile Components

You can add the 2FA components to any custom profile page:

<x-filament-panels::page>
    @livewire(\Wirement\Profile\TwoFactor\Livewire\TwoFactorAuthentication::class)
    @livewire(\Wirement\Profile\TwoFactor\Livewire\PasskeyAuthentication::class)
</x-filament-panels::page>

Middleware

The package includes middleware for:

  • TwoFactorChallenge - Prompts for 2FA verification
  • ForceTwoFactorSetup - Requires users to set up 2FA

Design Philosophy

Wirement Profile follows modern design principles:

  • Clean, Apple-inspired aesthetics with subtle gradients and shadows
  • Consistent spacing and visual rhythm
  • Large touch targets for better usability
  • Neutral color palette with elegant accent colors
  • Typography using Inter or SF Pro fonts

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

wirement/wirement-profile 适用场景与选型建议

wirement/wirement-profile 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 08 月 25 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「package」 「laravel」 「profile」 「2fa」 「two-factor-authentication」 「filament」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 wirement/wirement-profile 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 wirement/wirement-profile 我们能提供哪些服务?
定制开发 / 二次开发

基于 wirement/wirement-profile 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-08-25