ldc-gen-game-web/app/Notifications/Customer/PrizeHasBeenSent.php
2023-12-13 15:48:18 +01:00

44 lines
1.1 KiB
PHP

<?php
namespace App\Notifications\Customer;
use App\Mail\Won\PrizeIsSentMail;
use App\Models\Customer;
use App\Models\Settings;
use Illuminate\Contracts\Mail\Mailable;
use Illuminate\Mail\Mailables\Address;
use Illuminate\Notifications\Notification;
class PrizeHasBeenSent extends Notification
{
/**
* Get the notification's delivery channels.
*
* @param object $notifiable
* @return array<int, string>
* @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
*/
public function via(object $notifiable): array
{
// phpcs:enable
return ['mail'];
}
/**
* Get the mail representation of the notification.
*
* @param \App\Models\Customer $notifiable
* @return \Illuminate\Contracts\Mail\Mailable
*/
public function toMail(Customer $notifiable): Mailable
{
/** @var \App\Models\Settings */
$settings = app(Settings::class);
return (new PrizeIsSentMail(
new Address(
$notifiable->email
),
$settings->name,
));
}
}