1 | <?php |
||
2 | |||
3 | namespace Ronmrcdo\Inventory\Resources; |
||
4 | |||
5 | use Illuminate\Http\Resources\Json\JsonResource; |
||
6 | |||
7 | class AttributeResource extends JsonResource |
||
8 | { |
||
9 | public function toArray($request) |
||
10 | { |
||
11 | return [ |
||
12 | 'id' => $this->id, |
||
0 ignored issues
–
show
Bug
Best Practice
introduced
by
![]() |
|||
13 | 'name' => $this->name, |
||
0 ignored issues
–
show
The property
name does not exist on Ronmrcdo\Inventory\Resources\AttributeResource . Since you implemented __get , consider adding a @property annotation.
![]() |
|||
14 | 'options' => collect($this->values)->map(function ($item) { |
||
0 ignored issues
–
show
The property
values does not exist on Ronmrcdo\Inventory\Resources\AttributeResource . Since you implemented __get , consider adding a @property annotation.
![]() |
|||
15 | return $item->value; |
||
16 | })->values()->toArray() |
||
17 | ]; |
||
18 | } |
||
19 | } |