Files
filament-whatsapp-conector/database/migrations/create_whatsapp_webhooks_table.php.stub
Wallace Martins 3bf496e8a9 feat: initial release v0.1.0
- 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
2025-12-07 10:14:40 -03:00

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');
}
};