Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 4
CRAP
0.00% covered (danger)
0.00%
0 / 1
testNotification
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 4
20
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 1
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
 toDatabase
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 1
2
 toArray
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace App\Notifications;
4
5use Illuminate\Bus\Queueable;
6use Illuminate\Contracts\Queue\ShouldQueue;
7use Illuminate\Notifications\Messages\MailMessage;
8use Illuminate\Notifications\Notification;
9
10class testNotification extends Notification
11{
12    use Queueable;
13    private $testData;
14    /**
15     * Create a new notification instance.
16     *
17     * @return void
18     */
19    public function __construct($testData)
20    {
21        $this->testData = $testData;
22    }
23
24    /**
25     * Get the notification's delivery channels.
26     *
27     * @param  mixed  $notifiable
28     * @return array
29     */
30    public function via($notifiable)
31    {
32        return ['database'];
33    }
34
35    /**
36     * Get the mail representation of the notification.
37     *
38     * @param  mixed  $notifiable
39     * @return \Illuminate\Notifications\Messages\MailMessage
40     */
41    // public function toMail($notifiable)
42    // {
43    //     return (new MailMessage)
44    //                 ->line('The introduction to the notification.')
45    //                 ->action('Notification Action', url('/'))
46    //                 ->line('Thank you for using our application!');
47    // }
48    public function toDatabase($notifiable)
49    {
50        return [
51            'test1'                =>$this->testData['test1'],
52            'test2'                =>$this->testData['test2'],
53            'test3'               =>$this->testData['test3'],
54        ];
55    }
56
57    /**
58     * Get the array representation of the notification.
59     *
60     * @param  mixed  $notifiable
61     * @return array
62     */
63    public function toArray($notifiable)
64    {
65        return [
66            //
67        ];
68    }
69}