Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
userResource | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
toArray | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace App\Http\Resources; |
4 | |
5 | use Illuminate\Http\Resources\Json\JsonResource; |
6 | |
7 | class userResource extends JsonResource |
8 | { |
9 | /** |
10 | * Transform the resource into an array. |
11 | * |
12 | * @param \Illuminate\Http\Request $request |
13 | * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable |
14 | */ |
15 | public function toArray($request) |
16 | { |
17 | return [ |
18 | 'id' => $this->id, |
19 | 'username' => $this->username, |
20 | 'name' => $this->name, |
21 | 'image' => $this->getImage(), |
22 | ]; |
23 | } |
24 | } |