49 lines
1.1 KiB
PHP
49 lines
1.1 KiB
PHP
|
<?php
|
||
|
|
||
|
namespace App\Notifications;
|
||
|
|
||
|
use App\Album;
|
||
|
use App\Mail\MailableBase;
|
||
|
use App\Mail\PhotoCommentApproved as PhotoCommentApprovedMailable;
|
||
|
use App\Photo;
|
||
|
use App\PhotoComment;
|
||
|
use Illuminate\Bus\Queueable;
|
||
|
use Illuminate\Notifications\Notification;
|
||
|
|
||
|
class PhotoCommentApproved extends Notification
|
||
|
{
|
||
|
use Queueable;
|
||
|
use DatabaseEmailNotification;
|
||
|
|
||
|
private $album;
|
||
|
private $comment;
|
||
|
private $photo;
|
||
|
|
||
|
/**
|
||
|
* Create a new notification instance.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function __construct(Album $album, Photo $photo, PhotoComment $comment)
|
||
|
{
|
||
|
$this->album = $album;
|
||
|
$this->photo = $photo;
|
||
|
$this->comment = $comment;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Get the mail representation of the notification.
|
||
|
*
|
||
|
* @param mixed $notifiable
|
||
|
* @return \Illuminate\Notifications\Messages\MailMessage|MailableBase
|
||
|
*/
|
||
|
public function toMail($notifiable)
|
||
|
{
|
||
|
$mailable = new PhotoCommentApprovedMailable($notifiable, $this->album, $this->photo, $this->comment);
|
||
|
|
||
|
$this->setPropertiesOnMailable($mailable, $notifiable);
|
||
|
|
||
|
return $mailable;
|
||
|
}
|
||
|
}
|