2023-12-13 10:01:52 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Notifications\Customer;
|
|
|
|
|
|
|
|
|
|
use App\Mail\Won\WinningProofSubmitedMail;
|
2025-06-25 17:56:24 +02:00
|
|
|
use App\Models\Settings;
|
2023-12-13 10:01:52 +01:00
|
|
|
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.
|
|
|
|
|
*
|
2025-06-25 17:56:24 +02:00
|
|
|
* @param string $first_name The client first name.
|
|
|
|
|
* @param \App\Models\Settings $settingsModel The settings name.
|
2023-12-13 10:01:52 +01:00
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function __construct(
|
2025-06-25 17:56:24 +02:00
|
|
|
protected string $first_name,
|
|
|
|
|
protected Settings $settingsModel,
|
2025-04-18 16:59:57 +02:00
|
|
|
) {
|
|
|
|
|
// Keep empty.
|
|
|
|
|
}
|
2023-12-13 10:01:52 +01:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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.
|
|
|
|
|
*
|
2024-01-17 14:57:47 +01:00
|
|
|
* @param object $notifiable
|
2023-12-13 10:01:52 +01:00
|
|
|
* @return \Illuminate\Contracts\Mail\Mailable
|
|
|
|
|
*/
|
2024-01-17 14:57:47 +01:00
|
|
|
public function toMail(object $notifiable): Mailable
|
2023-12-13 10:01:52 +01:00
|
|
|
{
|
2024-01-17 14:57:47 +01:00
|
|
|
/** @var \App\Models\Customer $notifiable */
|
2023-12-13 10:01:52 +01:00
|
|
|
return (new WinningProofSubmitedMail(
|
|
|
|
|
new Address(
|
|
|
|
|
$notifiable->email,
|
2025-08-26 06:51:16 +00:00
|
|
|
$this->first_name,
|
2023-12-13 10:01:52 +01:00
|
|
|
),
|
2025-06-25 17:56:24 +02:00
|
|
|
$this->settingsModel,
|
2023-12-13 10:01:52 +01:00
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
}
|