69 lines
1.6 KiB
PHP
69 lines
1.6 KiB
PHP
|
<?php
|
||
|
|
||
|
namespace App\Notifications;
|
||
|
|
||
|
use Illuminate\Bus\Queueable;
|
||
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||
|
use Illuminate\Notifications\Messages\MailMessage;
|
||
|
use Illuminate\Notifications\Notification;
|
||
|
use Illuminate\Support\Facades\Auth;
|
||
|
|
||
|
class NotifiUserVerified extends Notification
|
||
|
{
|
||
|
use Queueable;
|
||
|
|
||
|
private $content;
|
||
|
|
||
|
/**
|
||
|
* Create a new notification instance.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function __construct($content)
|
||
|
{
|
||
|
$this->content = $content;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 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)
|
||
|
{
|
||
|
$user = Auth::user()->name;
|
||
|
|
||
|
return (new MailMessage)
|
||
|
->subject($this->content['subject'])
|
||
|
->greeting($user . ' - ' . $this->content['title'])
|
||
|
->line($this->content['description'])
|
||
|
->action('Przejdź do strony', url('/'))
|
||
|
->line('Dziękujemy za używanie naszej aplikacji!');
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Get the array representation of the notification.
|
||
|
*
|
||
|
* @param mixed $notifiable
|
||
|
* @return array
|
||
|
*/
|
||
|
public function toArray($notifiable)
|
||
|
{
|
||
|
return [
|
||
|
'message' => $this->content['name'] . ' add You to follow',
|
||
|
];
|
||
|
}
|
||
|
}
|