frolax/filament-phone-auth

This is my package filament-phone-auth

v1.0.0 2025-06-14 17:09 UTC

This package is auto-updated.

Last update: 2025-06-14 17:11:01 UTC


README

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

A Laravel package that adds phone number-based two-factor authentication to your Filament admin panel. This package provides a secure way to implement phone verification as a second factor for authentication in your Filament applications.

Features

  • Phone number-based two-factor authentication for Filament
  • Customizable verification code generation
  • Rate limiting for code requests
  • Configurable code expiration time
  • Customizable notification system
  • Easy integration with existing Filament applications
  • User-friendly management interface

Requirements

  • PHP 8.2 or higher
  • Laravel 10.x
  • Filament 4.x

Installation

You can install the package via composer:

composer require frolax/filament-phone-auth

Publish the configuration file:

php artisan vendor:publish --tag="filament-phone-auth-config"

Configuration

The package configuration file (config/filament-phone-auth.php) allows you to customize various aspects of the phone authentication:

return [
    'notification' => \Frolax\FilamentPhoneAuth\Notifications\VerifyPhoneAuthentication::class,
    // Add other configuration options as needed
];

Usage

  1. Implement the HasPhoneAuthentication interface in your User model:
use Frolax\FilamentPhoneAuth\Contracts\HasPhoneAuthentication;

class User extends Authenticatable implements HasPhoneAuthentication
{
    public function hasPhoneAuthentication(): bool
    {
        return $this->phone_authentication_enabled;
    }

    public function togglePhoneAuthentication(bool $enabled): void
    {
        $this->phone_authentication_enabled = $enabled;
        $this->save();
    }
}

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.