Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
AngelTypeResource | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
toArray | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace Engelsystem\Controllers\Api\Resources; |
6 | |
7 | use Engelsystem\Models\AngelType; |
8 | use Engelsystem\Models\BaseModel; |
9 | use Illuminate\Support\Collection; |
10 | |
11 | class AngelTypeResource extends BasicResource |
12 | { |
13 | protected Collection | BaseModel | AngelType $model; |
14 | |
15 | public function toArray(): array |
16 | { |
17 | return [ |
18 | 'id' => $this->model->id, |
19 | 'name' => $this->model->name, |
20 | 'description' => $this->model->description, |
21 | 'restricted' => $this->model->restricted, |
22 | 'url' => url('/angeltypes', ['action' => 'view', 'angeltype_id' => $this->model->id]), |
23 | ]; |
24 | } |
25 | } |