verbesserung von benachrichtungen und warnungen an nutzer abgeschlossen. layout editor nun auf gutem stand.

This commit is contained in:
Codex Agent
2025-11-02 11:11:13 +01:00
parent 8e6c66f0db
commit 792b5dfe8b
32 changed files with 1292 additions and 149 deletions

View File

@@ -0,0 +1,37 @@
<?php
namespace App\Services\Packages;
use App\Models\Tenant;
use App\Models\TenantNotificationLog;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Log;
class TenantNotificationLogger
{
public function log(Tenant $tenant, array $attributes): TenantNotificationLog
{
$context = Arr::get($attributes, 'context', []);
$log = $tenant->notificationLogs()->create([
'type' => $attributes['type'] ?? 'unknown',
'channel' => $attributes['channel'] ?? 'mail',
'recipient' => $attributes['recipient'] ?? null,
'status' => $attributes['status'] ?? 'sent',
'context' => $context,
'sent_at' => $attributes['sent_at'] ?? now(),
'failed_at' => $attributes['failed_at'] ?? null,
'failure_reason' => $attributes['failure_reason'] ?? null,
]);
Log::info('tenant_notification_log', [
'tenant_id' => $tenant->id,
'log_id' => $log->id,
'type' => $log->type,
'status' => $log->status,
'recipient' => $log->recipient,
]);
return $log;
}
}