mirror of
https://github.com/koel/koel
synced 2024-12-20 17:43:36 +00:00
28 lines
624 B
PHP
28 lines
624 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use App\Models\PlaylistCollaborationToken;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class PlaylistCollaborationTokenResource extends JsonResource
|
|
{
|
|
public const JSON_STRUCTURE = [
|
|
'type',
|
|
'token',
|
|
];
|
|
|
|
public function __construct(private readonly PlaylistCollaborationToken $token)
|
|
{
|
|
parent::__construct($token);
|
|
}
|
|
|
|
/** @return array<mixed> */
|
|
public function toArray($request): array
|
|
{
|
|
return [
|
|
'type' => 'playlist_collaboration_tokens',
|
|
'token' => $this->token->token,
|
|
];
|
|
}
|
|
}
|