Issues (73)

src/Resources/AttributeResource.php (3 issues)

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
The property id does not exist on Ronmrcdo\Inventory\Resources\AttributeResource. Since you implemented __get, consider adding a @property annotation.
Loading history...
13
			'name' => $this->name,
0 ignored issues
show
Bug Best Practice introduced by
The property name does not exist on Ronmrcdo\Inventory\Resources\AttributeResource. Since you implemented __get, consider adding a @property annotation.
Loading history...
14
			'options' => collect($this->values)->map(function ($item) {
0 ignored issues
show
Bug Best Practice introduced by
The property values does not exist on Ronmrcdo\Inventory\Resources\AttributeResource. Since you implemented __get, consider adding a @property annotation.
Loading history...
15
				return $item->value;
16
			})->values()->toArray()
17
		];
18
	}
19
}