mirror of
https://github.com/koel/koel
synced 2024-12-27 04:53:08 +00:00
22 lines
501 B
PHP
22 lines
501 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Http\Resources;
|
||
|
|
||
|
use Illuminate\Http\Request;
|
||
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||
|
use PhanAn\Poddle\Values\Category;
|
||
|
|
||
|
class PodcastCategoryResource extends JsonResource
|
||
|
{
|
||
|
public function __construct(private readonly Category $category)
|
||
|
{
|
||
|
parent::__construct($this->category);
|
||
|
}
|
||
|
|
||
|
/** @inheritDoc */
|
||
|
public function toArray(Request $request): array
|
||
|
{
|
||
|
return ['type' => 'podcast-categories'] + $this->category->toArray();
|
||
|
}
|
||
|
}
|