Skip to content

Commit

Permalink
Rename package to filament-2fa
Browse files Browse the repository at this point in the history
  • Loading branch information
Baspa committed Aug 23, 2024
1 parent 349e2fd commit ae786da
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 28 deletions.
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
32 changes: 18 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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:

Expand All @@ -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.**

Expand Down Expand Up @@ -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

Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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:*"
},
Expand Down

0 comments on commit ae786da

Please sign in to comment.