mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
33 lines
800 B
PHP
33 lines
800 B
PHP
<?php
|
|
|
|
namespace App\Features;
|
|
|
|
use App\Dto\CharacterMangaLookupCommand;
|
|
use App\Http\Resources\V4\CharacterMangaCollection;
|
|
use App\Support\CachedData;
|
|
use Illuminate\Http\JsonResponse;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
use Illuminate\Support\Collection;
|
|
|
|
/**
|
|
* @extends ItemLookupHandler<CharacterMangaLookupCommand, JsonResponse>
|
|
*/
|
|
final class CharacterMangaLookupHandler extends ItemLookupHandler
|
|
{
|
|
protected function resource(CachedData $results): JsonResource
|
|
{
|
|
/** @noinspection PhpUndefinedMethodInspection */
|
|
return new CharacterMangaCollection(
|
|
$results->get("mangaography")
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @inheritDoc
|
|
*/
|
|
public function requestClass(): string
|
|
{
|
|
return CharacterMangaLookupCommand::class;
|
|
}
|
|
}
|