Created
October 23, 2017 12:35
-
-
Save XavRsl/3ce7f866310f0fd76c8b982d1316910f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Notifications; | |
use App\Services\ModelHasher; | |
use Illuminate\Notifications\Notification; | |
use Illuminate\Notifications\Messages\MailMessage; | |
class VerifyEmail extends Notification | |
{ | |
use Queueable; | |
/** | |
* 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('Email verification needed') | |
->action( | |
'Verify your email', | |
url('/subscriber/verify?token='.(new ModelHasher())->encode($notifiable)) | |
) | |
->line('Thank you.'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment