2024-01-18 11:13:05 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
|
|
|
|
use App\Models\PlaylistCollaborationToken;
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
|
|
|
|
class PlaylistCollaborationTokenResource extends JsonResource
|
|
|
|
{
|
2024-01-25 16:21:26 +00:00
|
|
|
public const JSON_STRUCTURE = [
|
|
|
|
'type',
|
|
|
|
'token',
|
|
|
|
];
|
|
|
|
|
2024-04-18 14:36:28 +00:00
|
|
|
public function __construct(private readonly PlaylistCollaborationToken $token)
|
2024-01-18 11:13:05 +00:00
|
|
|
{
|
|
|
|
parent::__construct($token);
|
|
|
|
}
|
|
|
|
|
|
|
|
/** @return array<mixed> */
|
|
|
|
public function toArray($request): array
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'type' => 'playlist_collaboration_tokens',
|
|
|
|
'token' => $this->token->token,
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|