Conditions | 3 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
18 | public function toArray($request): array |
||
19 | { |
||
20 | /** @var User $this */ |
||
21 | return [ |
||
22 | 'id' => $this->id, |
||
23 | 'first_name' => $this->first_name, |
||
24 | 'last_name' => $this->last_name, |
||
25 | 'username' => $this->username, |
||
26 | 'full_name' => $this->first_name && $this->last_name |
||
27 | ? $this->first_name . ' ' . $this->last_name |
||
28 | : ($this->first_name ?? $this->last_name ?? 'Base Member'), |
||
29 | 'image' => $this->avatar_url, |
||
30 | 'role' => $this->roles?->first()->name ?? null, |
||
31 | ]; |
||
34 |