- Evolution API v2 integration with full HTTP client - WhatsApp instance management (Create, Connect, Delete, LogOut, Restart) - Real-time QR Code display with Alpine.js countdown timer - Pairing code support for WhatsApp Web linking - Webhook endpoint for receiving Evolution API events - Complete instance settings (reject calls, always online, read messages, etc.) - Filament v4 Resource with modal QR Code after instance creation - Table actions for Connect, View, and Edit - Status badges with Filament's native components - Full translations support (English and Portuguese) - Native Filament multi-tenancy support - DTOs with Spatie Laravel Data for type safety - Laravel Events for extensibility - Background job processing for webhooks and messages - Comprehensive configuration file
44 lines
1.2 KiB
Plaintext
44 lines
1.2 KiB
Plaintext
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
use WallaceMartinss\FilamentEvolution\Database\Migrations\Concerns\HasTenantColumn;
|
|
|
|
return new class extends Migration
|
|
{
|
|
use HasTenantColumn;
|
|
|
|
public function up(): void
|
|
{
|
|
Schema::create('whatsapp_webhooks', function (Blueprint $table) {
|
|
$table->id();
|
|
|
|
// Dynamic tenant column based on config
|
|
$this->addTenantColumn($table);
|
|
|
|
$table->foreignUuid('instance_id')
|
|
->nullable()
|
|
->constrained('whatsapp_instances')
|
|
->nullOnDelete();
|
|
|
|
$table->string('event');
|
|
$table->json('payload');
|
|
$table->boolean('processed')->default(false);
|
|
$table->text('error')->nullable();
|
|
$table->integer('processing_time_ms')->nullable();
|
|
$table->timestamps();
|
|
|
|
$table->index(['event', 'processed']);
|
|
$table->index('created_at');
|
|
});
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('whatsapp_webhooks');
|
|
}
|
|
};
|