frolax / filament-phone-auth
This is my package filament-phone-auth
Fund package maintenance!
frolax
Requires
- php: ^8.2
- filament/filament: ^4.0
- spatie/laravel-package-tools: ^1.0
Requires (Dev)
- laravel/pint: ^1.22
- nunomaduro/collision: ^8.8
- nunomaduro/larastan: ^3.4
- orchestra/testbench: ^10.4
- pestphp/pest: ^3.8
- pestphp/pest-plugin-arch: ^3.1
- pestphp/pest-plugin-laravel: ^3.2
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- spatie/laravel-ray: ^1.40
README
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
- 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.