Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 11
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
ExtensionFilesResource
0.00% covered (danger)
0.00%
0 / 11
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 toArray
0.00% covered (danger)
0.00%
0 / 11
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace App\Http\Resources\v2;
4
5use Illuminate\Http\Request;
6use Illuminate\Http\Resources\Json\JsonResource;
7
8/**
9 * Resource for transforming extension files response
10 *
11 * Wraps production and staging extension files with metadata.
12 */
13class ExtensionFilesResource extends JsonResource
14{
15    /**
16     * Transform the resource into an array.
17     *
18     * @param  Request  $request
19     * @return array<string, mixed>
20     */
21    public function toArray($request): array
22    {
23        return [
24            'production' => $this->resource['production'] ?? [],
25            'staging' => $this->resource['staging'] ?? [],
26            'meta' => $this->resource['meta'] ?? [
27                'current_page' => 1,
28                'per_page' => 30,
29                'total' => 0,
30                'total_production' => 0,
31                'total_staging' => 0,
32            ],
33        ];
34    }
35}