CustomerTokenResource   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 13 1
1
<?php
2
3
namespace Finder\Http\Resources\Consumo;
4
5
use Illuminate\Http\Resources\Json\JsonResource;
6
7
class CustomerTokenResource extends JsonResource
8
{
9
    public $with = [
10
        'success' => true
11
    ];
12
13
    /**
14
     * Transform the resource into an array.
15
     *
16
     * @param  \Illuminate\Http\Request $request
17
     * @return array
18
     */
19
    public function toArray($request)
20
    {
21
        return [
22
            'id' => $this->customer->id,
23
            'name' => $this->customer->name,
24
            'nome' => $this->customer->name,
25
            'cpf' => $this->customer->cpf,
26
            'user_token' => $this->token,
27
            'token' => $this->company_token,
28
            'created_at' => (string) $this->created_at,
29
            'updated_at' => (string) $this->updated_at
30
        ];
31
    }
32
}
33