ImportWasCompleted::toMail()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace App\Notifications\Frontend;
4
5
use App\Models\Batch;
6
use Illuminate\Bus\Queueable;
7
use Illuminate\Contracts\Queue\ShouldQueue;
8
use Illuminate\Notifications\Messages\MailMessage;
9
use Illuminate\Notifications\Notification;
10
11
class ImportWasCompleted extends Notification implements ShouldQueue
12
{
13
    use Queueable;
14
    /**
15
     * @var Batch
16
     */
17
    public $batch;
18
19
    /**
20
     * Create a new notification instance.
21
     *
22
     * @return void
23
     */
24
    public function __construct(Batch $batch)
25
    {
26
        $this->batch = $batch;
27
    }
28
29
    /**
30
     * Get the notification's delivery channels.
31
     *
32
     * @param  mixed  $notifiable
33
     * @return array
34
     */
35
    public function via($notifiable)
36
    {
37
        return ['mail'];
38
    }
39
40
    /**
41
     * Get the mail representation of the notification.
42
     *
43
     * @param  mixed  $notifiable
44
     * @return \Illuminate\Notifications\Messages\MailMessage
45
     */
46
    public function toMail($notifiable)
47
    {
48
        return (new MailMessage)
49
            ->line('Your vocabularies have been imported.')
50
            ->action('View Report', url("/projects/{$this->batch->project->id}/imports/{$this->batch->id}/results"))
51
            ->line('Thank you for using the Open Metadata Registry!');
52
    }
53
54
    /**
55
     * Get the array representation of the notification.
56
     *
57
     * @param  mixed  $notifiable
58
     * @return array
59
     */
60
    public function toArray($notifiable)
61
    {
62
        return [
63
            //
64
        ];
65
    }
66
}
67