承接 aurorawebsoftware/filament-loginkit 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

aurorawebsoftware/filament-loginkit

最新稳定版本:12.1.0

Composer 安装命令:

composer require aurorawebsoftware/filament-loginkit

包简介

This is my package filament-loginkit

README 文档

README

A flexible authentication kit for Filament that brings enhanced two-factor authentication, SMS login, and customizable login flows to your Laravel applications.

Table of Contents

Installation

First, install the package via Composer:

composer require aurorawebsoftware/filament-loginkit

Then, run the install command to set up configuration, migrations, assets, and required dependencies:

php artisan filament-loginkit:install

Add the plugin to your PanelProvider:

plugin(FilamentLoginKitPlugin::make())

To require two-factor authentication for all users, use the forced() method:

plugin(FilamentLoginKitPlugin::make()->forced())

User Model Changes

Make sure your User model implements the necessary properties and traits:

<?php

use AuroraWebSoftware\FilamentLoginKit\Traits\TwoFactorAuthenticatable;

class User extends Authenticatable
{
    use TwoFactorAuthenticatable;

    protected $fillable = [
        'phone_number',
        'two_factor_type',
        'is_2fa_required',
        'sms_login_code',
        'sms_login_expires_at',
        'two_factor_code',
        'two_factor_expires_at',
        'is_active',
        'whatsapp_login_code',
        'whatsapp_login_expires_at'
    ];

    protected $casts = [
        'email_verified_at' => 'datetime',
        'password' => 'hashed',
        'sms_login_expires_at' => 'datetime',
        'is_2fa_required' => 'boolean',
        'two_factor_expires_at' => 'datetime',
        'is_active'=>'boolean'
        'whatsapp_login_expires_at' => 'datetime',
    ];
}

Configuration

After publishing the config file, you can find it at config/filament-loginkit.php.

Login Methods

Enable/disable email and SMS login:

'email_login' => env('LOGINKIT_EMAIL_LOGIN_ENABLED', true),

'sms_login' => env('LOGINKIT_SMS_LOGIN_ENABLED', false),

Two-Factor Authentication

Set available two-factor methods: authenticator, email, sms

'options' => [
    \AuroraWebSoftware\FilamentLoginKit\Enums\TwoFactorType::authenticator,
    \AuroraWebSoftware\FilamentLoginKit\Enums\TwoFactorType::email,
    \AuroraWebSoftware\FilamentLoginKit\Enums\TwoFactorType::sms,
],

Features

Enable or disable registration, multi-tenancy, or generic error messages:

'enabled_features' => [
    'register' => false,
    'multi_tenancy' => false,
    'generic_errors' => false,
],

SMS Service

To enable SMS authentication, you must implement your own SMS service using the provided interface.

You can find the interface at:

AuroraWebSoftware\FilamentLoginKit\Contracts\SmsServiceInterface

First, create a class that implements this interface. For example:

namespace App\Services;

use AuroraWebSoftware\FilamentLoginKit\Contracts\SmsServiceInterface;

class SmsService implements SmsServiceInterface
{
    public function sendSms(string $phone, string $message): void
    {
        // Your SMS sending logic here
    }
}

Then, register your service in the configuration file:

// config/filament-loginkit.php
'sms_service_class' => \App\Services\SmsService::class,

Note: Your SMS service must implement all methods required by SmsServiceInterface.

Rate Limits

Limit login and 2FA attempts to prevent abuse:

'rate_limits' => [
    'sms' => [
        'max_requests' => 5,
        'per_minutes' => 1,
    ],
    'sms_resend' => [
        'max_requests' => 2,
        'per_minutes' => 1,
    ],
    'login' => [
        'max_requests' => 5,
        'per_minutes' => 1,
    ],
    'two_factor' => [
        'max_requests' => 5,
        'per_minutes' => 1,
    ],
],

Queues

Set whether notifications are queued:

'queue_notifications' => env('LOGINKIT_QUEUE_NOTIFICATIONS', true),
'email_queue' => env('LOGINKIT_EMAIL_QUEUE', 'filament-loginkit'),
'sms_queue' => env('LOGINKIT_SMS_QUEUE', 'filament-loginkit'),

The queue name used by Filament Loginkit is filament-loginkit.

To start the queue worker in Laravel, run the following command:

php artisan queue:work --queue=filament-loginkit

And more! Please check the config/filament-loginkit.php file for the full list of options.

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.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-07-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固