Certified/app/Notifications/CertificateExpiredNotification.php
Joël van de Wouw ac340d125c
Some checks failed
linter / quality (push) Failing after 13s
tests / ci (8.3) (push) Failing after 2s
tests / ci (8.4) (push) Failing after 2s
tests / ci (8.5) (push) Failing after 3s
Initial commit
Certificate manager built on Laravel 13, Livewire 4, and Flux.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-12 14:44:58 +02:00

35 lines
1.1 KiB
PHP

<?php
namespace App\Notifications;
use App\Models\Certificate;
use App\Models\User;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class CertificateExpiredNotification extends Notification
{
use Queueable;
public function __construct(public Certificate $certificate) {}
/**
* @return array<int, string>
*/
public function via(object $notifiable): array
{
return ['mail'];
}
public function toMail(User $notifiable): MailMessage
{
return (new MailMessage)
->error()
->subject(__('Certificate expires today: :title', ['title' => $this->certificate->title]))
->greeting(__('Hello :name,', ['name' => $notifiable->name]))
->line(__('Your certificate ":title" expires today.', ['title' => $this->certificate->title]))
->action(__('View your certificates'), route('certificates.index'))
->line(__('Renew it as soon as possible to avoid a lapse in compliance.'));
}
}