File: D:/HostingSpaces/SBogers10/shop.komma.nl/app/Properties/Resources/KeyValueTranslation.php
<?php
namespace App\Properties\Resources;
use App\Properties\Models\PropertyKeyTranslation;
use App\Properties\Models\PropertyValueTranslation;
use Illuminate\Http\Resources\Json\JsonResource;
use Komma\KMS\Globalization\Resources\LanguageResource;
/**
* Class Property
*
* @mixin PropertyKeyTranslation|PropertyValueTranslation
* @package App\Properties\Resources
*/
class KeyValueTranslation extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function toArray($request)
{
return [
'id' => $this->id,
'name' => $this->name,
'state' => $this->state,
'language' => $this->whenLoaded('language', (new KeyValueTranslationLanguage($this->language)))
];
}
}