2018-09-07 02:24:41 -07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Notifications;
|
|
|
|
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
|
|
use Illuminate\Notifications\Messages\MailMessage;
|
2019-03-13 20:12:03 -07:00
|
|
|
use Illuminate\Notifications\Notification;
|
2018-09-07 02:24:41 -07:00
|
|
|
|
|
|
|
class CurrentInventory extends Notification
|
|
|
|
{
|
|
|
|
use Queueable;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new notification instance.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function __construct($user)
|
|
|
|
{
|
|
|
|
$this->user = $user;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the notification's delivery channels.
|
|
|
|
*
|
|
|
|
* @param mixed $notifiable
|
|
|
|
* @return array
|
|
|
|
*/
|
2020-05-23 11:56:56 -07:00
|
|
|
public function via()
|
2018-09-07 02:24:41 -07:00
|
|
|
{
|
|
|
|
return ['mail'];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the mail representation of the notification.
|
|
|
|
*
|
|
|
|
* @return \Illuminate\Notifications\Messages\MailMessage
|
|
|
|
*/
|
2020-05-23 11:56:56 -07:00
|
|
|
public function toMail()
|
2018-09-07 02:24:41 -07:00
|
|
|
{
|
|
|
|
$message = (new MailMessage)->markdown('notifications.markdown.user-inventory',
|
|
|
|
[
|
|
|
|
'assets' => $this->user->assets,
|
|
|
|
'accessories' => $this->user->accessories,
|
|
|
|
'licenses' => $this->user->licenses,
|
|
|
|
])
|
2023-02-07 16:29:19 -08:00
|
|
|
->subject(trans('mail.inventory_report'));
|
2018-09-07 02:24:41 -07:00
|
|
|
|
|
|
|
return $message;
|
|
|
|
}
|
|
|
|
}
|