| Install | |
|---|---|
composer require jeffersongoncalves/mfakitv5 |
|
| Latest Version: | 5.4.1 |
| PHP: | ^8.3 |

MFAKit is a robust starter kit built on Laravel 12.x and Filament 5.x, designed to accelerate the development of modern web applications with a ready-to-use multi-panel structure.
/admin) - For system administrators/app) - For authenticated application usersconfig/mfakit.php fileClone the repository
laravel new my-app --using=jeffersongoncalves/mfakitv5 --database=mysql
Or use FilaKit CLI for a simplified setup:
filakit new my-app --kit=jeffersongoncalves/mfakitv5
Install FilaKit CLI:
composer global require jeffersongoncalves/filakit-cli
MFAKit can be easily installed using the following command:
php install.php
This command automates the installation process by:
Install JavaScript dependencies
pnpm install
Install Composer dependencies
composer install
Set up environment
cp .env.example .env
php artisan key:generate
Configure your database in the .env file
Run migrations
php artisan migrate
Run the server
php artisan serve
Clone the repository
laravel new my-app --using=jeffersongoncalves/mfakitv5 --database=mysql
Move into the project directory
cd my-app
Install Composer dependencies
composer install
Set up environment
cp .env.example .env
Configuring custom ports may be necessary if you have other services running on the same ports.
# Application Port (ex: 8080)
APP_PORT=8080
# MySQL Port (ex: 3306)
FORWARD_DB_PORT=3306
# Redis Port (ex: 6379)
FORWARD_REDIS_PORT=6379
# Mailpit Port (ex: 1025)
FORWARD_MAILPIT_PORT=1025
Start the Sail containers
./vendor/bin/sail up -d
You won’t need to run php artisan serve, as Laravel Sail automatically handles the development server within the container.
Attach to the application container
./vendor/bin/sail shell
Generate the application key
php artisan key:generate
Install JavaScript dependencies
pnpm install
MFAKit comes pre-configured with a custom authentication system that supports different types of users:
Admin - For administrative panel accessUser - For application panel access# Run the development server with logs, queues and asset compilation
composer dev
# Or run each component separately
php artisan serve
php artisan queue:listen --tries=1
pnpm run dev
Panels can be customized through their respective providers:
app/Providers/Filament/AdminPanelProvider.phpapp/Providers/Filament/AppPanelProvider.phpapp/Providers/Filament/PublicPanelProvider.phpAlternatively, these settings are also consolidated in the config/mfakit.php file for easier management.
Each panel can have its own color scheme, which can be easily modified in the corresponding Provider files or in the
mfakit.php configuration file.
The config/mfakit.php file centralizes the configuration of the starter kit, including:
This project already comes with the Filament Edit Profile plugin integrated for the Admin and App panels. It adds a complete profile editing page with avatar, language, theme color, security (tokens, MFA), browser sessions, and email/password change.
Where to configure
Panel providers
General settings: config/filament-edit-profile.php
Migrations and models
Avatar storage
Quick access
Reference
This starter kit comes with Filament's built‑in Multi‑Factor Authentication already wired into the Admin and App panels. You can manage MFA from the My Profile page and/or force users to configure MFA before accessing the panel.
Where it appears
->shouldShowMultiFactorAuthentication() in the Edit Profile plugin (already set in both panels)Configured providers (default in this kit)
// In app/Providers/Filament/AdminPanelProvider.php and AppPanelProvider.php
->multiFactorAuthentication([
AppAuthentication::make()
->brandName('MFA Kit Demo')
->recoverable(), // allows recovery codes
EmailAuthentication::make(),
WhatsAppAuthentication::make(), // requires WhatsApp connector setup (see section below)
])
Notes about providers
->recoverable() option enables recovery codes for account lockout scenarios.Requiring MFA and routes
// In your Panel provider (Admin/App)
->requiresMultiFactorAuthentication()
/admin/multi-factor-authentication/set-up/app/multi-factor-authentication/set-up->multiFactorAuthenticationRoutePrefix('mfa') // default: "multi-factor-authentication"
->setUpRequiredMultiFactorAuthenticationRouteSlug('setup') // default: "set-up"
Edit Profile integration
->shouldShowMultiFactorAuthentication() is enabled on the Edit Profile plugin instance (already enabled in this kit). You can toggle it per panel.Troubleshooting
.env mailer setup)->authGuard(...) matches your intended usersThis starter kit ships with the WhatsApp Connector plugin (Evolution API v2 client) already required in composer.json and registered in the 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 in this kit
wallacemartinss/filament-whatsapp-conector is includedapp/Providers/Filament/AdminPanelProvider.php where FilamentEvolutionPlugin::make()->whatsappInstanceResource()->viewMessageHistory()->viewWebhookLogs() is addedphp artisan vendor:publish --tag="filament-evolution-config"
php artisan vendor:publish --tag="filament-evolution-migrations"
php artisan migrate
# 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
EVOLUTION_WEBHOOK_URL to your public URL pointing to: https://your-app.com/api/webhooks/evolution.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',
],
];
SendWhatsappMessageAction to tables/pages/widgetsExamples (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 MFAKit!'),
];
}
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');
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
EVOLUTION_URL and EVOLUTION_API_KEY, and that your Evolution API v2 instance is reachable from the appEVOLUTION_WEBHOOK_URL is a public HTTPS URL to /api/webhooks/evolution, no auth/CSRF blocking, and that your hosting firewall allows inbound requestsEVOLUTION_MEDIA_DISK permissions and file size limitsphp artisan queue:listen) and that the configured queue connection is availableReference
MFAKit includes support for:
This project is licensed under the MIT License.
Developed by Jefferson Gonçalves.