Deploy: 2026-05-21 15:33:14

This commit is contained in:
Hamza-Ayed
2026-05-21 15:33:14 +03:00
parent aae860486a
commit 6210a57565
13 changed files with 1826 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
<?php
namespace App\Models;
use App\Core\Security;
/**
* MessageLog Model
* Records every message sent or received with full payload encryption.
*/
class MessageLog extends BaseModel
{
protected string $table = 'messages_log';
/**
* Securely log a new message
*/
public function logMessage(array $data)
{
if (!empty($data['contact_phone'])) {
$data['contact_phone_hash'] = Security::blindIndex($data['contact_phone']);
$data['contact_phone'] = Security::encrypt($data['contact_phone']);
}
if (!empty($data['message_body'])) {
$data['message_body'] = Security::encrypt($data['message_body']);
}
if (!empty($data['media_url'])) {
$data['media_url'] = Security::encrypt($data['media_url']);
}
return $this->create($data);
}
}