jikan-rest/app/Features/AnimeStreamingLookupHandler.php
2023-05-21 11:18:02 +01:00

32 lines
717 B
PHP

<?php
namespace App\Features;
use App\Dto\AnimeStreamingLookupCommand;
use App\Http\Resources\V4\StreamingLinksResource;
use App\Support\CachedData;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Support\Collection;
/**
* @extends ItemLookupHandler<AnimeStreamingLookupCommand, JsonResponse>
*/
final class AnimeStreamingLookupHandler extends ItemLookupHandler
{
protected function resource(CachedData $results): JsonResource
{
return new StreamingLinksResource(
$results
);
}
/**
* @inheritDoc
*/
public function requestClass(): string
{
return AnimeStreamingLookupCommand::class;
}
}