File: D:/HostingSpaces/stafa/werkenbijstafa.nl/app/Komma/Shop/Properties/Models/Api/PropertyResource.php
<?php
namespace App\Komma\Shop\Properties\Models\Api;
use Illuminate\Http\Resources\Json\Resource;
class PropertyResource extends Resource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function toArray($request)
{
return [
'id' => $this->id,
'code_name' => $this->code_name,
'key' => $this->when($this->key, new PropertyKeyResource($this->key)),
'value' => $this->when($this->value, new PropertyValueResource($this->value)),
];
}
}