• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

conedevelopment / root / 15084089635

17 May 2025 10:00AM UTC coverage: 77.93% (+0.04%) from 77.891%
15084089635

push

github

web-flow
Modernize back-end.yml (#240)

3291 of 4223 relevant lines covered (77.93%)

36.04 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

40.0
/src/Notifications/AuthCodeNotification.php
1
<?php
2

3
namespace Cone\Root\Notifications;
4

5
use Cone\Root\Models\AuthCode;
6
use Illuminate\Bus\Queueable;
7
use Illuminate\Contracts\Queue\ShouldQueue;
8
use Illuminate\Notifications\Messages\MailMessage;
9
use Illuminate\Notifications\Notification;
10
use Illuminate\Support\Facades\Config;
11
use Illuminate\Support\Facades\URL;
12

13
class AuthCodeNotification extends Notification implements ShouldQueue
14
{
15
    use Queueable;
16

17
    /**
18
     * Delete the job if its models no longer exist.
19
     *
20
     * @var bool
21
     */
22
    public $deleteWhenMissingModels = true;
23

24
    /**
25
     * The auth code instance.
26
     */
27
    protected AuthCode $code;
28

29
    /**
30
     * Create a new notification instance.
31
     */
32
    public function __construct(#[\SensitiveParameter] AuthCode $code)
2✔
33
    {
34
        $this->code = $code;
2✔
35
    }
36

37
    /**
38
     * Get the notification's delivery channels.
39
     *
40
     * @return array<int, string>
41
     */
42
    public function via(object $notifiable): array
2✔
43
    {
44
        return ['mail'];
2✔
45
    }
46

47
    /**
48
     * Get the mail representation of the notification.
49
     */
50
    public function toMail(object $notifiable): MailMessage
×
51
    {
52
        return (new MailMessage)
×
53
            ->subject(sprintf('%s - %s', Config::get('app.name'), __('Two Factor Code')))
×
54
            ->line(__('Your verification code is: :code.', ['code' => $this->code->code]))
×
55
            ->action(__('Verify Authentication'), URL::route('root.auth.two-factor.show', ['code' => $this->code->code]))
×
56
            ->line(__('The code expires at :date.', ['date' => $this->code->expires_at->format('Y-m-d H:i:s')]));
×
57
    }
58
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc