Files
phpvms/app/Notifications/Messages/UserRegistered.php
Nabeel S ea3ab21beb 391 Notification refactorings (#441)
* Refactor notifications to allow easier plugins

* Notification refactoring

* Formatting

* Move news to NewsService; cleanup of events

* More refactoring; added send email out for news item and the template

* Formatting

* Formatting
2019-11-20 10:16:01 -05:00

40 lines
764 B
PHP

<?php
namespace App\Notifications\Messages;
use App\Models\User;
use App\Notifications\BaseNotification;
use App\Notifications\Channels\MailChannel;
class UserRegistered extends BaseNotification
{
use MailChannel;
private $user;
/**
* Create a new notification instance.
*
* @param \App\Models\User $user
*/
public function __construct(User $user)
{
parent::__construct();
$this->user = $user;
$this->setMailable(
'Welcome to '.config('app.name').'!',
'notifications.mail.user.registered',
['user' => $this->user]
);
}
public function toArray($notifiable)
{
return [
'user_id' => $this->user->id,
];
}
}