1
0
Fork 0
owl-admin-starter/app/Http/Resources/KeywordResource.php

34 lines
878 B
PHP

<?php
namespace App\Http\Resources;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class KeywordResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @return array<string, mixed>
*/
public function toArray(Request $request): array
{
return [
'id' => $this->id,
'key' => $this->key,
'name' => $this->name,
'value' => $this->value,
'parent_id' => $this->parent_id,
'path' => $this->path,
'sort' => $this->sort,
'options' => $this->options,
'image' => $this->image,
'images' => $this->images,
'description' => $this->description,
'content' => $this->content,
'created_at' => $this->created_at?->timestamp,
];
}
}