定制 offline-agency/filament-spid 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

offline-agency/filament-spid

Composer 安装命令:

composer require offline-agency/filament-spid

包简介

SPID authentication plugin for Filament based on italia/spid-laravel

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

SPID (Sistema Pubblico di Identità Digitale) authentication plugin for Filament based on italia/spid-laravel.

This package allows you to integrate SPID authentication into your Filament admin panels, enabling Italian public administration identity management.

Filament SPID Banner

Features

  • 🇮🇹 Full SPID integration for Filament
  • 🔐 Secure SAML2 authentication
  • 🎨 Customizable login view
  • 🔧 Compatible with Filament 3 & 4
  • 📦 Support for Laravel 10, 11, 12
  • ⚡ PHP 8.2+ ready
  • 🧪 Fully tested

Requirements

  • PHP 8.2 or higher
  • Laravel 10.x, 11.x, or 12.x
  • Filament 3.x or 4.x
  • italia/spid-laravel package

Installation

You can install the package via composer:

composer require offline-agency/filament-spid

Publish the configuration file:

php artisan vendor:publish --tag="filament-spid-config"

Publish and run the migrations:

php artisan vendor:publish --tag="filament-spid-migrations"
php artisan migrate

Optionally, you can publish the views:

php artisan vendor:publish --tag="filament-spid-views"

Publishing Images

To publish the SPID AGID logo images to your public directory:

php artisan vendor:publish --tag="filament-spid-images"

This will copy the SPID AGID logo images (both PNG and SVG formats) to:

  • public/vendor/filament-spid/images/
  • public/images/

The images will be accessible at:

  • /vendor/filament-spid/images/spid-agid-logo.png
  • /vendor/filament-spid/images/spid-agid-logo.svg

Alternatively, you can use the provided script in the package root:

./publish-images.sh

SPID Configuration

First, configure the base SPID Laravel package. Follow the italia/spid-laravel documentation to:

  1. Generate SPID certificates
  2. Configure your Service Provider metadata
  3. Set up SPID Identity Providers

Add the following fields to your users table migration (if not already published):

$table->string('fiscal_code')->unique()->nullable();
$table->json('spid_data')->nullable();

Usage

Register the plugin in your Filament Panel Provider:

use OfflineAgency\FilamentSpid\SpidPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->default()
        ->id('admin')
        ->path('admin')
        ->plugin(
            SpidPlugin::make()
                ->spidButtonLabel('Entra con SPID')
                ->providers([
                    'arubaid',
                    'infocertid',
                    'lepidaid',
                    'namirialid',
                    'posteid',
                    'sielteid',
                    'spiditalia',
                    'timid',
                    'teamsystemid'
                ])
        );
}

Customization

Custom Login View

SpidPlugin::make()
    ->loginView('your-custom-view')

Custom Routes

SpidPlugin::make()
    ->loginRoute('custom.spid.login')
    ->logoutRoute('custom.spid.logout')
    ->acsRoute('custom.spid.acs')
    ->metadataRoute('custom.spid.metadata')

Hide SPID Button

SpidPlugin::make()
    ->showSpidButton(false)

Custom Button Label and Icon

SpidPlugin::make()
    ->spidButtonLabel('Login con SPID')
    ->spidButtonIcon('heroicon-o-shield-check')

Select Specific Providers

SpidPlugin::make()
    ->providers(['posteid', 'arubaid', 'infocertid'])

Configuration

The config/filament-spid.php configuration file allows you to customize:

return [
    'user_model' => \App\Models\User::class,
    'redirect_after_login' => '/admin',
    'spid_level' => 'https://www.spid.gov.it/SpidL2',
];

User Model

Your User model should have these fields:

protected $fillable = [
    'name',
    'email',
    'fiscal_code',
    'spid_data',
    // ... other fields
];

protected $casts = [
    'spid_data' => 'array',
];

SPID Levels

SPID supports three security levels:

  • SpidL1 - Level 1 (Username and password)
  • SpidL2 - Level 2 (Username, password, and OTP) - Default
  • SpidL3 - Level 3 (Smart card or hardware token)

Configure the level in your config file or when calling the login:

route('spid.login', ['provider' => 'posteid', 'level' => 'SpidL2'])

Testing

composer test

Run tests with coverage:

composer test-coverage

Code Style

composer format

Static Analysis

composer analyse

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

Support

For support and questions:

License

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

About Offline Agency

Offline Agency is a web development agency based in Italy, specializing in Laravel and Filament applications.

offline-agency/filament-spid 适用场景与选型建议

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

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

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

围绕 offline-agency/filament-spid 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-10-09