web-mooc/app/Notifications/InstructorApprovalNotification.php

43 lines
994 B
PHP

<?php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class InstructorApprovalNotification extends Notification
{
use Queueable;
protected $application;
public function __construct($application)
{
$this->application = $application;
}
public function via(object $notifiable): array
{
return ['mail'];
}
public function toMail(object $notifiable): MailMessage
{
return (new MailMessage)
->subject(get_phrase('Instructor Application Approved') . ' - ' . config('app.name'))
->view('vendor.notifications.instructor_approval', [
'user' => $notifiable,
'application' => $this->application
]);
}
public function toArray(object $notifiable): array
{
return [
//
];
}
}