Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 13
0.00% covered (danger)
0.00%
0 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
ResetPassword
0.00% covered (danger)
0.00%
0 / 13
0.00% covered (danger)
0.00%
0 / 3
12
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 via
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 toMail
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace App\Notifications\User;
4
5use Illuminate\Notifications\Messages\MailMessage;
6use Illuminate\Notifications\Notification;
7use Illuminate\Support\Facades\Lang;
8
9class ResetPassword extends Notification
10{
11    /**
12     * The password reset token.
13     *
14     * @var string
15     */
16    public $token;
17
18    public string $frontendBaseUrl;
19
20    /**
21     * Create a notification instance.
22     *
23     * @return void
24     */
25    public function __construct(string $token)
26    {
27        $this->token = $token;
28        $this->frontendBaseUrl = config('romeo.frontend-base-url');
29    }
30
31    /**
32     * Get the notification's channels.
33     *
34     * @param  mixed  $notifiable
35     * @return array|string
36     */
37    public function via($notifiable): array
38    {
39        return ['mail'];
40    }
41
42    /**
43     * Build the mail representation of the notification.
44     *
45     * @param  mixed  $notifiable
46     */
47    public function toMail($notifiable): MailMessage
48    {
49        $url = $this->frontendBaseUrl.'/session/change-password'.'?'.
50            'email='.$notifiable->getEmailForPasswordReset().'&'.
51            'token='.$this->token;
52
53        return (new MailMessage)
54            ->bcc(config('hubspotconfig.bcc_email'))
55            ->subject(Lang::get('Out with the old and in with the new'))
56            ->view('mail.user.reset', [
57                'name' => $notifiable->first_name,
58                'url' => $url,
59            ]);
60    }
61}