mirror of
https://github.com/koel/koel
synced 2024-12-25 20:13:06 +00:00
27 lines
633 B
PHP
27 lines
633 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Http\Resources;
|
||
|
|
||
|
use App\Models\PlaylistFolder;
|
||
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||
|
|
||
|
class PlaylistFolderResource extends JsonResource
|
||
|
{
|
||
|
public function __construct(private PlaylistFolder $folder)
|
||
|
{
|
||
|
parent::__construct($folder);
|
||
|
}
|
||
|
|
||
|
/** @return array<mixed> */
|
||
|
public function toArray($request): array
|
||
|
{
|
||
|
return [
|
||
|
'type' => 'playlist_folders',
|
||
|
'id' => $this->folder->id,
|
||
|
'name' => $this->folder->name,
|
||
|
'user_id' => $this->folder->user_id,
|
||
|
'created_at' => $this->folder->created_at,
|
||
|
];
|
||
|
}
|
||
|
}
|