Skip to content

v2.0.0

Choose a tag to compare

@afsakar afsakar released this 19 Jun 10:23
· 6 commits to v2 since this release

Release Notes

Breaking Changes

  • This release targets Filament ^4.0 || ^5.0.
  • PHP ^8.2 is now required.
  • Runtime configuration has moved from the config file to FilamentOtpLoginPlugin.
  • The published config file is now intentionally empty.
  • The OTP table column has changed from email to identifier.
  • Active OTP codes generated before upgrading will no longer verify because OTP codes are now stored as hashes.
  • Custom published login views must be updated for Filament v4/v5 components and translation namespaces.
  • Custom references to the removed package OTP input must be replaced with Filament’s native OneTimeCodeInput.

Added

  • Added Filament v4/v5 compatibility.
  • Added panel-level configuration through FilamentOtpLoginPlugin.
  • Added configurable OTP identifier support.
  • Added support for phone, username, or custom identifier fields.
  • Added configurable user model support.
  • Added configurable user identifier column support.
  • Added passwordless OTP login mode.
  • Added configurable login rate limits.
  • Added configurable resend rate limits.
  • Added support for Filament’s native OneTimeCodeInput.
  • Added an upgrade migration stub to rename otp_codes.email to otp_codes.identifier.
  • Added README upgrade guide for major-version migration.
  • Added tests for plugin configuration, OTP hashing, passwordless mode, rate limits, resend limits, and Filament compatibility.

Changed

  • OTP codes are now generated using random_int().
  • OTP codes are now hashed before being stored in the database.
  • OTP verification now uses hash checking instead of plain-text lookup.
  • Notification class selection now happens through the plugin.
  • OTP expiration is passed into the notification constructor.
  • Login form identifier field is now configurable per panel.
  • OTP table name is now configured through the plugin.
  • Package configuration is grouped in a plugin configuration trait for readability.

Removed

  • Removed runtime dependency on config('filament-otp-login.*').
  • Removed custom OTP input usage in favor of Filament’s native OneTimeCodeInput.
  • Removed config-based notification_class, passwordless, rate_limit, resend_limit, and otp_code settings.

Upgrade Notes

Configure the plugin in your panel provider:

FilamentOtpLoginPlugin::make()
    ->otpCode(length: 6, expiresIn: 120)
    ->rateLimit(attempts: 5, decaySeconds: 60)
    ->resendLimit(attempts: 3, decaySeconds: 300)
    ->passwordless(false)
    ->notification(\Afsakar\FilamentOtpLogin\Notifications\SendOtpCode::class);

// For phone-based login:

FilamentOtpLoginPlugin::make()
    ->identifierFormField('phone', label: 'Phone', type: 'tel')
    ->userIdentifierColumn('phone');

// Rename the OTP table column when upgrading:

Schema::table('otp_codes', function (Blueprint $table) {
    $table->renameColumn('email', 'identifier');
});

// If you published package views, republish them or update them manually for Filament v4/v5.