From ae786dae1518f001d540f1d8665eed4f6a1f688a Mon Sep 17 00:00:00 2001 From: Baspa Date: Fri, 23 Aug 2024 10:11:03 +0200 Subject: [PATCH] Rename package to filament-2fa --- .github/ISSUE_TEMPLATE/config.yml | 6 +++--- CHANGELOG.md | 4 ++-- README.md | 32 +++++++++++++++++-------------- composer.json | 10 +++++----- package-lock.json | 2 +- package.json | 6 +++--- 6 files changed, 32 insertions(+), 28 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 21b9d9e..7d7284e 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,11 +1,11 @@ blank_issues_enabled: false contact_links: - name: Ask a question - url: https://github.com/vormkracht10/filament-two-factor-auth/discussions/new?category=q-a + url: https://github.com/vormkracht10/filament-2fa/discussions/new?category=q-a about: Ask the community for help - name: Request a feature - url: https://github.com/vormkracht10/filament-two-factor-auth/discussions/new?category=ideas + url: https://github.com/vormkracht10/filament-2fa/discussions/new?category=ideas about: Share ideas for new features - name: Report a security issue - url: https://github.com/vormkracht10/filament-two-factor-auth/security/policy + url: https://github.com/vormkracht10/filament-2fa/security/policy about: Learn how to notify us for sensitive bugs diff --git a/CHANGELOG.md b/CHANGELOG.md index 30ad9b0..83bce33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Changelog -All notable changes to `filament-two-factor-auth` will be documented in this file. +All notable changes to `filament-2fa` will be documented in this file. ## 1.0.0 - 202X-XX-XX -- initial release +- initial release diff --git a/README.md b/README.md index 04bf894..756bf14 100644 --- a/README.md +++ b/README.md @@ -1,40 +1,43 @@ # Filament Two Factor Authentication (2FA) plugin -[![Latest Version on Packagist](https://img.shields.io/packagist/v/vormkracht10/filament-two-factor-auth.svg?style=flat-square)](https://packagist.org/packages/vormkracht10/filament-two-factor-auth) -[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/vormkracht10/filament-two-factor-auth/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/vormkracht10/filament-two-factor-auth/actions?query=workflow%3Arun-tests+branch%3Amain) -[![Total Downloads](https://img.shields.io/packagist/dt/vormkracht10/filament-two-factor-auth.svg?style=flat-square)](https://packagist.org/packages/vormkracht10/filament-two-factor-auth) - +[![Latest Version on Packagist](https://img.shields.io/packagist/v/vormkracht10/filament-2fa.svg?style=flat-square)](https://packagist.org/packages/vormkracht10/filament-2fa) +[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/vormkracht10/filament-2fa/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/vormkracht10/filament-2fa/actions?query=workflow%3Arun-tests+branch%3Amain) +[![Total Downloads](https://img.shields.io/packagist/dt/vormkracht10/filament-2fa.svg?style=flat-square)](https://packagist.org/packages/vormkracht10/filament-2fa) This package adds Two Factor Authentication for your Laravel Filament app, using the first party package Laravel Fortify. We provide the views and logic to enable Two Factor Authentication (2FA) in your Filament app. Possible authentication methods are: -- Email -- SMS -- Authenticator app +- Email +- SMS +- Authenticator app ## Features and screenshots ### Enable Two Factor Authentication (2FA) + ![Enable Two Factor Authentication (2FA)](./docs/two-factor-page.png) ### Using authenticator app as two factor method + ![Authenticator app](./docs/authenticator-app.png) ### Using email or SMS as two factor method + ![Email or SMS](./docs/email-or-sms.png) ### Recovery codes + ![Recovery codes](./docs/recovery-codes.png) ### Two Factor authentication challenge -![Two Factor challenge](./docs/code-challenge.png) +![Two Factor challenge](./docs/code-challenge.png) ## Installation You can install the package via composer: ```bash -composer require vormkracht10/filament-two-factor-auth +composer require vormkracht10/filament-2fa ``` If you don't have [Laravel Fortify](https://laravel.com/docs/11.x/fortify) installed yet, you can install it by running the following commands: @@ -65,7 +68,7 @@ Then add the plugin to your `PanelProvider`: Make sure your user uses the `TwoFactorAuthenticatable` trait: -```php +```php class User extends Authenticatable implements FilamentUser { use HasApiTokens, HasFactory, Notifiable, TwoFactorAuthenticatable; @@ -108,11 +111,12 @@ protected $listen = [ ], ]; ``` + ## Usage ### Configuration -The authentication methods can be configured in the `config/filament-two-factor-auth.php` file (which is published during the install command). +The authentication methods can be configured in the `config/filament-two-factor-auth.php` file (which is published during the install command). You can simply add or remove (comment) the methods you want to use: @@ -128,7 +132,7 @@ return [ ]; ``` -If you want to use the SMS method, you need to provide an SMS service. You can check the [Laravel Notifications documentation](https://laravel-notification-channels.com/about/) for ready-to-use services. +If you want to use the SMS method, you need to provide an SMS service. You can check the [Laravel Notifications documentation](https://laravel-notification-channels.com/about/) for ready-to-use services. **Also make sure your user model has a `phone` attribute.** @@ -171,8 +175,8 @@ Please review [our security policy](../../security/policy) on how to report secu ## Credits -- [Baspa](https://github.com/vormkracht10) -- [All Contributors](../../contributors) +- [Baspa](https://github.com/vormkracht10) +- [All Contributors](../../contributors) ## License diff --git a/composer.json b/composer.json index 3a75e6a..d9e6e24 100644 --- a/composer.json +++ b/composer.json @@ -1,15 +1,15 @@ { - "name": "vormkracht10/filament-two-factor-auth", + "name": "vormkracht10/filament-2fa", "description": "This package helps you integrate Laravel Fortify with ease in your Filament apps. ", "keywords": [ "vormkracht10", "laravel", - "filament-two-factor-auth" + "filament-2fa" ], - "homepage": "https://github.com/vormkracht10/filament-two-factor-auth", + "homepage": "https://github.com/vormkracht10/filament-2fa", "support": { - "issues": "https://github.com/vormkracht10/filament-two-factor-auth/issues", - "source": "https://github.com/vormkracht10/filament-two-factor-auth" + "issues": "https://github.com/vormkracht10/filament-2fa/issues", + "source": "https://github.com/vormkracht10/filament-2fa" }, "license": "MIT", "authors": [ diff --git a/package-lock.json b/package-lock.json index 3c6e87c..246d479 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "filament-two-factor-auth", + "name": "filament-2fa", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package.json b/package.json index 6e730ee..35dfb38 100644 --- a/package.json +++ b/package.json @@ -2,11 +2,11 @@ "private": true, "type": "module", "scripts": { - "dev:styles": "npx tailwindcss -i resources/css/index.css -o resources/dist/filament-two-factor-auth.css --postcss --watch", + "dev:styles": "npx tailwindcss -i resources/css/index.css -o resources/dist/filament-2fa.css --postcss --watch", "dev:scripts": "node bin/build.js --dev", - "build:styles": "npx tailwindcss -i resources/css/index.css -o resources/dist/filament-two-factor-auth.css --postcss --minify && npm run purge", + "build:styles": "npx tailwindcss -i resources/css/index.css -o resources/dist/filament-2fa.css --postcss --minify && npm run purge", "build:scripts": "node bin/build.js", - "purge": "filament-purge -i resources/dist/filament-two-factor-auth.css -o resources/dist/filament-two-factor-auth.css -v 3.x", + "purge": "filament-purge -i resources/dist/filament-2fa.css -o resources/dist/filament-2fa.css -v 3.x", "dev": "npm-run-all --parallel dev:*", "build": "npm-run-all build:*" },