2023-12-13 10:01:52 +01:00
|
|
|
<?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.
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function __construct(
|
|
|
|
|
protected string $first_name
|
2025-08-26 06:51:16 +00:00
|
|
|
) {}
|
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
|
|
|
{
|
|
|
|
|
/** @var \App\Models\Settings */
|
|
|
|
|
$settings = app(Settings::class);
|
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
|
|
|
),
|
|
|
|
|
$settings->name,
|
2025-08-26 06:51:16 +00:00
|
|
|
$settings->company,
|
2023-12-13 10:01:52 +01:00
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
}
|