Files
water_new/modules/Cms/Http/Resources/PageResource.php
2023-03-08 09:16:04 +08:00

28 lines
810 B
PHP

<?php
namespace Modules\Cms\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
class PageResource extends JsonResource
{
public function toArray($request): array
{
return [
'page_id' => $this->id,
'title' => $this->title,
'sub_title' => $this->sub_title,
'tags' => TagResource::collection($this->tags),
'description' => $this->description,
'slug' => $this->slug,
'cover' => $this->cover_url,
'pictures' => $this->pictures_url,
'clicks' => $this->clicks,
'content' => $this->content,
'attachments' => $this->attachments_url,
'created_at' => (string) $this->created_at,
];
}
}