Skip to content

A self-hosted media server and file management system

518 B
Raw Blame
<?php

namespace App\Http\Resources;

use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;

class TagResource extends JsonResource {
    /**
     * Transform the resource into an array.
     *
     * @return array<string, mixed>
     */
    public function toArray(Request $request): array {
        return [
            'id' => $this->id,
            'name' => $this->name,
            'relationships' => [
                'creator_id' => $this->creator_id,
            ],
        ];
    }
}