PHPackages                             jeffersongoncalves/filament-multifactor-whatsapp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. jeffersongoncalves/filament-multifactor-whatsapp

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

jeffersongoncalves/filament-multifactor-whatsapp
================================================

Filament 5 multi‑factor authentication via WhatsApp one‑time codes, with optional Evolution API connector integration.

2.0.3(1mo ago)16139↑28.1%22MITPHPPHP ^8.2CI passing

Since Dec 9Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/jeffersongoncalves/filament-multifactor-whatsapp)[ Packagist](https://packagist.org/packages/jeffersongoncalves/filament-multifactor-whatsapp)[ Docs](https://github.com/jeffersongoncalves/filament-multifactor-whatsapp)[ GitHub Sponsors](https://github.com/jeffersongoncalves)[ RSS](/packages/jeffersongoncalves-filament-multifactor-whatsapp/feed)WikiDiscussions 2.x Synced today

READMEChangelog (9)Dependencies (24)Versions (11)Used By (2)

[![Filament Multifactor Whatsapp](https://raw.githubusercontent.com/jeffersongoncalves/filament-multifactor-whatsapp/2.x/art/jeffersongoncalves-filament-multifactor-whatsapp.png)](https://raw.githubusercontent.com/jeffersongoncalves/filament-multifactor-whatsapp/2.x/art/jeffersongoncalves-filament-multifactor-whatsapp.png)

Filament Multifactor Whatsapp
=============================

[](#filament-multifactor-whatsapp)

[![Latest Version on Packagist](https://camo.githubusercontent.com/ca1bab2b56c191346513e44a022fcd511b84e00bee1128f7556fe96d639528ff/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6566666572736f6e676f6e63616c7665732f66696c616d656e742d6d756c7469666163746f722d77686174736170702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jeffersongoncalves/filament-multifactor-whatsapp)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/8095362e371905d4dd051fe8753f024237f079e2041709d03205e667f1428cc8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a6566666572736f6e676f6e63616c7665732f66696c616d656e742d6d756c7469666163746f722d77686174736170702f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d322e78266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/jeffersongoncalves/filament-multifactor-whatsapp/actions?query=workflow%3A%22Fix+PHP+code+styling%22+branch%3A2.x)[![Total Downloads](https://camo.githubusercontent.com/82f258611b81c5f47de863e3b90f7d69e08b3c38bc8ac28906fd011e2821608d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6566666572736f6e676f6e63616c7665732f66696c616d656e742d6d756c7469666163746f722d77686174736170702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jeffersongoncalves/filament-multifactor-whatsapp)[![License](https://camo.githubusercontent.com/2bf4de14bc229209c3e2053bce76ffab37ab6bcd90b4ce52dc3738a798683569/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6a6566666572736f6e676f6e63616c7665732f66696c616d656e742d6d756c7469666163746f722d77686174736170702e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

Requirements
------------

[](#requirements)

- PHP 8.2 or higher
- Filament 5.0

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require jeffersongoncalves/filament-multifactor-whatsapp
```

WhatsApp authentication
-----------------------

[](#whatsapp-authentication)

WhatsApp authentication sends the user one-time codes to their WhatsApp address, which they must enter to verify their identity.

To enable WhatsApp authentication in a panel, you must first add a new column to your `users` table (or whichever table is being used for your "authenticatable" Eloquent model in this panel). The column needs to store a boolean indicating whether or not WhatsApp authentication is enabled:

```
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

Schema::table('users', function (Blueprint $table) {
    $table->boolean('has_whatsapp_authentication')->default(false);
});
```

In the `User` model, you need to ensure that this column is cast to a boolean:

```
use Filament\Models\Contracts\FilamentUser;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable implements FilamentUser
{
    /**
     * @return array
     */
    protected function casts(): array
    {
        return [
            // ...
            'has_whatsapp_authentication' => 'boolean',
        ];
    }

    // ...
}
```

Next, you should implement the `HasWhatsAppAuthentication` interface on the `User` model. This provides Filament with the necessary methods to interact with the column that indicates whether or not WhatsApp authentication is enabled:

```
use Filament\Models\Contracts\FilamentUser;
use Illuminate\Foundation\Auth\User as Authenticatable;
use JeffersonGoncalves\Filament\MultiFactorWhatsApp\Contracts\HasWhatsAppAuthentication;

class User extends Authenticatable implements FilamentUser, HasWhatsAppAuthentication
{
    // ...

    public function hasWhatsappAuthentication(): bool
    {
        // This method should return true if the user has enabled WhatsApp authentication.

        return $this->has_whatsapp_authentication;
    }

    public function toggleWhatsappAuthentication(bool $condition): void
    {
        // This method should save whether or not the user has enabled WhatsApp authentication.

        $this->has_whatsapp_authentication = $condition;
        $this->save();
    }
}
```

Tip: Since Filament uses an interface on your `User` model instead of assuming that the `has_whatsapp_authentication` column exists, you can use any column name you want. You could even use a different model entirely if you want to store the setting in a different table.

Finally, you should activate the WhatsApp authentication feature in your panel. To do this, use the `multiFactorAuthentication()` method in the panel configuration, and pass a `WhatsAppAuthentication` instance to it:

```
use Filament\Panel;
use JeffersonGoncalves\Filament\MultiFactorWhatsApp\WhatsAppAuthentication;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->multiFactorAuthentication([
            WhatsAppAuthentication::make(),
        ]);
}
```

### Changing the WhatsApp code expiration time

[](#changing-the-whatsapp-code-expiration-time)

WhatsApp codes are issued with a lifetime of 4 minutes, after which they expire.

To change the expiration period, for example to only be valid for 2 minutes after codes are generated, you can use the `codeExpiryMinutes()` method on the `WhatsAppAuthentication` instance, set to `2`:

```
use Filament\Panel;
use JeffersonGoncalves\Filament\MultiFactorWhatsApp\WhatsAppAuthentication;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->multiFactorAuthentication([
            WhatsAppAuthentication::make()
                ->codeExpiryMinutes(2),
        ]);
}
```

WhatsApp Connector — wallacemartinss/filament-whatsapp-conector
---------------------------------------------------------------

[](#whatsapp-connector--wallacemartinssfilament-whatsapp-conector)

This starter kit ships with the WhatsApp Connector plugin (Evolution API v2 client) already required in `composer.json` and ready to be registered in your Filament Admin panel. It lets you manage WhatsApp instances, display live QR Codes to connect, log webhooks, and send messages (text, images, videos, audio, documents) from Filament actions or your own services.

What’s already configured

- Dependency: `wallacemartinss/filament-whatsapp-conector` is included
- Admin panel registration: add to your Admin panel provider `FilamentEvolutionPlugin::make()->whatsappInstanceResource()->viewMessageHistory()->viewWebhookLogs()`

### 1) Publish config and run migrations

[](#1-publish-config-and-run-migrations)

```
php artisan vendor:publish --tag="filament-evolution-config"
php artisan vendor:publish --tag="filament-evolution-migrations"
php artisan migrate
```

### 2) Environment variables (.env)

[](#2-environment-variables-env)

Add your Evolution API credentials and webhook settings:

```
# Evolution API connection (required)
EVOLUTION_URL=https://your-evolution-api.com
EVOLUTION_API_KEY=your_api_key

# Webhook URL (required to receive events)
# Use the public URL to your app’s webhook endpoint (see below):
EVOLUTION_WEBHOOK_URL=https://your-app.com/api/webhooks/evolution

# Optional security secret (recommended)
EVOLUTION_WEBHOOK_SECRET=your_secret_key

# Optional defaults (useful for single‑instance setups)
EVOLUTION_DEFAULT_INSTANCE=your_instance_id
```

### 3) Webhook endpoint

[](#3-webhook-endpoint)

- The plugin exposes an endpoint for Evolution API to POST events (QR updates, messages, connection changes, etc.).
- Set `EVOLUTION_WEBHOOK_URL` to your public URL pointing to: `https://your-app.com/api/webhooks/evolution`.
- Ensure your app is accessible publicly and that the route is not blocked by auth or CSRF.

### 4) Optional configuration (config/filament-evolution.php)

[](#4-optional-configuration-configfilament-evolutionphp)

After publishing, you can tune behaviors such as queues, storage, cleanup, and tenancy. Key options:

```
return [
    'queue' => [
        'enabled' => true,
        'connection' => null, // default connection
        'name' => 'default',
    ],
    'storage' => [
        'webhooks' => true,   // persist webhook payloads
        'messages' => true,   // persist sent/received messages
    ],
    'cleanup' => [
        'webhooks_days' => 30,
        'messages_days' => 90,
    ],
    'instance' => [
        'reject_call' => false,
        'always_online' => false,
        // ...other defaults
    ],
    'tenancy' => [
        'enabled' => false,
        'column' => 'team_id',
        'table' => 'teams',
        'model' => 'App\\Models\\Team',
    ],
];
```

### 5) Managing WhatsApp instances (Admin panel)

[](#5-managing-whatsapp-instances-admin-panel)

1. Go to: WhatsApp &gt; Instances
2. Create a new instance (name/phone)
3. Save to open the QR Code modal
4. Scan the QR Code with your WhatsApp
5. Watch status updates (Always Online, Read Messages, Reject Calls, etc.)

### 6) Sending messages

[](#6-sending-messages)

The plugin provides three ways to send WhatsApp messages:

- Filament Action (UI): attach `SendWhatsappMessageAction` to tables/pages/widgets
- Facade: quick sending from anywhere in your code
- Trait: integrate into your services for reusable sending logic

Examples (UI actions)

```
use WallaceMartinss\\FilamentEvolution\\Actions\\SendWhatsappMessageAction;

// In a resource table
public function table(Table $table): Table
{
    return $table
        ->actions([
            SendWhatsappMessageAction::make(),
        ]);
}

// In a page header
protected function getHeaderActions(): array
{
    return [
        SendWhatsappMessageAction::make()
            // Optional sensible defaults
            ->number('5511999999999')
            ->message('Hello from EvolutionKit!'),
    ];
}
```

Prefilling from records

```
SendWhatsappMessageAction::make()
    ->numberFrom('phone')                // attribute on the record
    ->instanceFrom('whatsapp_instance_id');
```

Limiting message types or hiding fields

```
use WallaceMartinss\\FilamentEvolution\\Enums\\MessageTypeEnum;

SendWhatsappMessageAction::make()
    ->allowedTypes([MessageTypeEnum::TEXT, MessageTypeEnum::IMAGE])
    ->hideInstanceSelect()
    ->hideNumberInput()
    ->textOnly();
```

Media storage (optional)

```
EVOLUTION_MEDIA_DISK=public
EVOLUTION_MEDIA_DIRECTORY=whatsapp-media
EVOLUTION_MEDIA_MAX_SIZE=16384
```

You can also specify a custom disk per action: `SendWhatsappMessageAction::make()->disk('s3');`

### 7) Cleanup command

[](#7-cleanup-command)

Remove old webhook/message records automatically:

```
php artisan evolution:cleanup           # uses config defaults
php artisan evolution:cleanup --dry-run # preview deletions
php artisan evolution:cleanup --webhooks-days=7 --messages-days=30
```

Schedule it (example):

```
// routes/console.php
use Illuminate\\Support\\Facades\\Schedule;
Schedule::command('evolution:cleanup')->daily();
```

### Troubleshooting

[](#troubleshooting)

- QR Code does not appear: verify `EVOLUTION_URL` and `EVOLUTION_API_KEY`, and that your Evolution API v2 instance is reachable from the app
- Webhooks not received: confirm `EVOLUTION_WEBHOOK_URL` is a public HTTPS URL to `/api/webhooks/evolution`, no auth/CSRF blocking, and that your hosting firewall allows inbound requests
- Media uploads failing: check `EVOLUTION_MEDIA_DISK` permissions and file size limits
- Messages queued but not sent: ensure queues are running (e.g., `php artisan queue:listen`) and that the configured queue connection is available

Reference

- Plugin repository:

Development
-----------

[](#development)

You can run code analysis and formatting using the following commands:

```
# Run static analysis
composer analyse

# Format code
composer format
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Jèfferson Gonçalves](https://github.com/jeffersongoncalves)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

48

—

FairBetter than 93% of packages

Maintenance91

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~19 days

Recently: every ~27 days

Total

11

Last Release

12d ago

Major Versions

1.0.1 → 2.0.02026-02-05

1.0.2 → 2.0.22026-03-04

1.0.3 → 2.0.32026-05-23

1.x-dev → 2.x-dev2026-06-22

PHP version history (2 changes)1.0.0PHP ^8.3

2.0.1PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/411493?v=4)[Jefferson Gonçalves](/maintainers/jeffersongoncalves)[@jeffersongoncalves](https://github.com/jeffersongoncalves)

---

Top Contributors

[![jeffersongoncalves](https://avatars.githubusercontent.com/u/411493?v=4)](https://github.com/jeffersongoncalves "jeffersongoncalves (51 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

2fafilamentfilament-pluginmfamfa-authenticatorwhatsapp-authenticationlaravelotpAuthentication2fatwo-factorwhatsappfilamentfilament-pluginjeffersongoncalvesMFAevolution-apione-time codemulti-factorfilament-multifactor-whatsappwhatsapp-connector

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/jeffersongoncalves-filament-multifactor-whatsapp/health.svg)

```
[![Health](https://phpackages.com/badges/jeffersongoncalves-filament-multifactor-whatsapp/health.svg)](https://phpackages.com/packages/jeffersongoncalves-filament-multifactor-whatsapp)
```

###  Alternatives

[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[stephenjude/filament-two-factor-authentication

Filament Two Factor Authentication: Google 2FA + Passkey Authentication

84215.9k9](/packages/stephenjude-filament-two-factor-authentication)[marcelweidum/filament-passkeys

Use passkeys in your filamentphp app

6649.5k1](/packages/marcelweidum-filament-passkeys)[croustibat/filament-jobs-monitor

Background Jobs monitoring like Horizon for all drivers for FilamentPHP

274327.2k9](/packages/croustibat-filament-jobs-monitor)[stephenjude/filament-jetstream

A Laravel starter kit built with Filament inspired by Jetstream.

17760.2k3](/packages/stephenjude-filament-jetstream)[caresome/filament-auth-designer

Transform Filament's default auth pages into stunning, brand-ready experiences

4244.3k3](/packages/caresome-filament-auth-designer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
