ldc-gen-game-web/app/Notifications/Customer/HasSubmitedWinProof.php
2025-08-29 15:01:34 +02:00

61 lines
1.6 KiB
PHP

<?php
namespace App\Notifications\Customer;
use App\Mail\Won\WinningProofSubmitedMail;
use App\Models\Settings;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Mail\Mailable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailables\Address;
use Illuminate\Notifications\Notification;
class HasSubmitedWinProof extends Notification implements ShouldQueue
{
use Queueable;
/**
* Create a new notification instance.
*
* @param string $first_name The client first name.
* @param \App\Models\Settings $settingsModel The settings name.
* @return void
*/
public function __construct(
protected string $first_name,
protected Settings $settingsModel,
) {
// Keep empty.
}
/**
* 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 object $notifiable
* @return \Illuminate\Contracts\Mail\Mailable
*/
public function toMail(object $notifiable): Mailable
{
/** @var \App\Models\Customer $notifiable */
return (new WinningProofSubmitedMail(
new Address(
$notifiable->email,
$this->first_name,
),
$this->settingsModel,
));
}
}