2023-01-21 01:53:37 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Features;
|
|
|
|
|
|
|
|
use App\Dto\PersonVoicesLookupCommand;
|
|
|
|
use App\Http\Resources\V4\PersonVoicesCollection;
|
2023-02-11 16:32:16 +00:00
|
|
|
use App\Support\CachedData;
|
2023-01-21 01:53:37 +00:00
|
|
|
use Illuminate\Http\JsonResponse;
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
use Illuminate\Support\Collection;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @extends ItemLookupHandler<PersonVoicesLookupCommand, JsonResponse>
|
|
|
|
*/
|
|
|
|
final class PersonVoicesLookupHandler extends ItemLookupHandler
|
|
|
|
{
|
|
|
|
public function requestClass(): string
|
|
|
|
{
|
|
|
|
return PersonVoicesLookupCommand::class;
|
|
|
|
}
|
|
|
|
|
2023-02-11 16:32:16 +00:00
|
|
|
protected function resource(CachedData $results): JsonResource
|
2023-01-21 01:53:37 +00:00
|
|
|
{
|
2023-02-11 16:32:16 +00:00
|
|
|
return new PersonVoicesCollection($results->get("voice_acting_roles"));
|
2023-01-21 01:53:37 +00:00
|
|
|
}
|
|
|
|
}
|