Passed
Push — master ( cf340d...4e06a8 )
by Arthur
06:10
created

DatabaseNotificationChannel   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 15
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A buildPayload() 0 6 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: arthur
5
 * Date: 15.10.18
6
 * Time: 13:27
7
 */
8
9
namespace Foundation\Channels;
10
11
12
use Illuminate\Notifications\Channels\DatabaseChannel;
13
use Illuminate\Notifications\Notification;
14
15
class DatabaseNotificationChannel extends DatabaseChannel
16
{
17
    /**
18
     * Build an array payload for the DatabaseNotification Model.
19
     *
20
     * @param  mixed  $notifiable
21
     * @param  \Illuminate\Notifications\Notification  $notification
22
     * @return array
23
     */
24
    protected function buildPayload($notifiable, Notification $notification)
25
    {
26
        return [
27
            'type' => get_class($notification),
28
            'data' => $this->getData($notifiable, $notification),
29
            'read_at' => null,
30
        ];
31
    }
32
}
33