2019-11-20 23:16:01 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Notifications\Messages;
|
|
|
|
|
2020-09-04 00:50:42 +08:00
|
|
|
use App\Contracts\Notification;
|
2019-11-20 23:16:01 +08:00
|
|
|
use App\Models\User;
|
|
|
|
use App\Notifications\Channels\MailChannel;
|
2021-05-20 23:54:07 +08:00
|
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
2019-11-20 23:16:01 +08:00
|
|
|
|
2021-05-20 23:54:07 +08:00
|
|
|
class UserPending extends Notification implements ShouldQueue
|
2019-11-20 23:16:01 +08:00
|
|
|
{
|
|
|
|
use MailChannel;
|
|
|
|
|
|
|
|
private $user;
|
|
|
|
|
|
|
|
/**
|
2021-06-04 22:51:59 +08:00
|
|
|
* @param User $user
|
2019-11-20 23:16:01 +08:00
|
|
|
*/
|
|
|
|
public function __construct(User $user)
|
|
|
|
{
|
2020-05-09 23:31:25 +08:00
|
|
|
parent::__construct();
|
|
|
|
|
2019-11-20 23:16:01 +08:00
|
|
|
$this->user = $user;
|
|
|
|
|
|
|
|
$this->setMailable(
|
|
|
|
'Your registration is pending',
|
|
|
|
'notifications.mail.user.pending',
|
|
|
|
['user' => $this->user]
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-06-04 22:51:59 +08:00
|
|
|
public function via($notifiable)
|
|
|
|
{
|
|
|
|
return ['mail'];
|
|
|
|
}
|
|
|
|
|
2019-11-20 23:16:01 +08:00
|
|
|
/**
|
|
|
|
* Get the array representation of the notification.
|
|
|
|
*
|
|
|
|
* @param mixed $notifiable
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function toArray($notifiable)
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'user_id' => $this->user->id,
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|