2024-05-23 12:47:02 -07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Notifications;
|
|
|
|
|
|
|
|
use App\Models\Asset;
|
|
|
|
use App\Models\User;
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
|
|
use Illuminate\Notifications\Messages\MailMessage;
|
|
|
|
use Illuminate\Notifications\Notification;
|
|
|
|
|
|
|
|
class UnacceptedAssetReminderNotification extends Notification
|
|
|
|
{
|
|
|
|
use Queueable;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new notification instance.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function __construct($checkout_info, $count)
|
|
|
|
{
|
|
|
|
$this->count = $count;
|
|
|
|
$this->target = $checkout_info['acceptance']->assignedTo;
|
2024-05-23 16:08:18 -07:00
|
|
|
$this->acceptance = $checkout_info['acceptance'];
|
|
|
|
|
2024-05-23 12:47:02 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the notification's delivery channels.
|
|
|
|
*
|
|
|
|
* @param mixed $notifiable
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function via()
|
|
|
|
{
|
|
|
|
return ['mail'];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the mail representation of the notification.
|
|
|
|
*
|
|
|
|
* @param mixed $notifiable
|
|
|
|
* @return \Illuminate\Notifications\Messages\MailMessage
|
|
|
|
*/
|
|
|
|
public function toMail()
|
|
|
|
{
|
2024-05-23 16:08:18 -07:00
|
|
|
$accept_url = route('account.accept');
|
2024-05-23 12:47:02 -07:00
|
|
|
$message = (new MailMessage)->markdown('notifications.markdown.asset-reminder',
|
|
|
|
[
|
|
|
|
'count' => $this->count,
|
|
|
|
'assigned_to' => $this->target->present()->fullName,
|
2024-05-23 16:08:18 -07:00
|
|
|
'link' => route('account.accept'),
|
|
|
|
'accept_url' => $accept_url,
|
2024-05-23 12:47:02 -07:00
|
|
|
])
|
|
|
|
->subject(trans('mail.unaccepted_asset_reminder'));
|
|
|
|
|
|
|
|
return $message;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the array representation of the notification.
|
|
|
|
*
|
|
|
|
* @param mixed $notifiable
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function toArray($notifiable)
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
//
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|