<?php namespace App\Notifications; use App\Album; use App\Mail\MailableBase; use App\Mail\PhotoCommentApprovedUser as PhotoCommentApprovedUserMailable; use App\Photo; use App\PhotoComment; use Illuminate\Bus\Queueable; use Illuminate\Notifications\Notification; class PhotoCommentApprovedUser 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 PhotoCommentApprovedUserMailable($notifiable, $this->album, $this->photo, $this->comment); $this->setPropertiesOnMailable($mailable, $notifiable); return $mailable; } }