Files
SkinbaseNova/app/Notifications/SecurityReportDangerNotification.php

41 lines
1.3 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Notifications;
use App\Models\SecurityReport;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
final class SecurityReportDangerNotification extends Notification implements ShouldQueue
{
use Queueable;
public function __construct(private readonly SecurityReport $report)
{
}
public function via(object $notifiable): array
{
return ['mail'];
}
public function toMail(object $notifiable): MailMessage
{
return (new MailMessage())
->subject('Skinbase Security Report Alert')
->greeting('Security report alert')
->line('High or critical dependency vulnerabilities were detected in the latest private security scan.')
->line('Status: ' . $this->report->status)
->line('Critical: ' . $this->report->total_critical)
->line('High: ' . $this->report->total_high)
->line('Medium: ' . $this->report->total_medium)
->line('Low: ' . $this->report->total_low)
->action('Open Security Report', url('/moderation/system/security-report/' . $this->report->id))
->line('This report is private and intended for administrators only.');
}
}