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

DatabaseNotificationChannel::buildPayload()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 2
dl 0
loc 6
ccs 0
cts 6
cp 0
crap 2
rs 10
c 0
b 0
f 0
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