Total Complexity | 3 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
16 | class UserTransformer extends Transformer |
||
17 | { |
||
18 | public $relations = [ |
||
19 | 'roles', |
||
20 | 'permissions', |
||
21 | ]; |
||
22 | |||
23 | /** |
||
24 | * Transform the resource into an array. |
||
25 | * |
||
26 | * @param \Illuminate\Http\Request $request |
||
27 | * |
||
28 | * @return array |
||
29 | */ |
||
30 | 6 | public function toArray($request) |
|
31 | { |
||
32 | return [ |
||
33 | 6 | 'id' => $this->id, |
|
|
|||
34 | 6 | 'name' => $this->name, |
|
35 | 6 | 'email' => $this->name, |
|
36 | 6 | 'email_verified' => $this->email_verified, |
|
37 | 6 | 'gender' => $this->gender, |
|
38 | 6 | 'provider' => $this->provider, |
|
39 | 6 | 'created_at' => $this->created_at, |
|
40 | 6 | 'updated_at' => $this->updated_at, |
|
41 | ]; |
||
42 | } |
||
43 | |||
44 | 5 | public function transformRoles(User $user) |
|
47 | } |
||
48 | |||
49 | 5 | public function transformPermissions(User $user) |
|
52 | } |
||
53 | } |
||
54 |