Completed
Push — master ( 2d22de...e2d103 )
by Sherif
02:14
created

PushNotificationDevice   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 21
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 12 1
1
<?php
2
3
namespace App\Modules\Notifications\Http\Resources;
4
5
use Illuminate\Http\Resources\Json\JsonResource;
6
use App\Modules\Acl\Http\Resources\AclUser as UserResource;
7
8
class PushNotificationDevice extends JsonResource
9
{
10
    /**
11
     * Transform the resource into an array.
12
     *
13
     * @param  \Illuminate\Http\Request  $request
14
     * @return array
15
     */
16
    public function toArray($request)
17
    {
18
        return [
19
            'id' => $this->id,
20
            'deviceToken' => $this->device_token,
21
            'accessToken' => $this->access_token,
22
            'user' => new UserResource($this->whenLoaded('user')),
23
            'timeZone' => $this->time_zone,
24
            'createdAt' => $this->created_at,
25
            'updatedAt' => $this->updated_at,
26
        ];
27
    }
28
}
29