mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
- instead of ordering by mal_id or popularity, weighted relevancy search happens based on the model's config
29 lines
650 B
PHP
29 lines
650 B
PHP
<?php
|
|
|
|
namespace App\Features;
|
|
|
|
use App\Dto\AnimeSearchCommand;
|
|
use App\Enums\AnimeOrderByEnum;
|
|
use App\Http\Resources\V4\AnimeCollection;
|
|
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
|
use Illuminate\Support\Collection;
|
|
|
|
/**
|
|
* @extends SearchRequestHandler<AnimeSearchCommand, AnimeCollection>
|
|
*/
|
|
class AnimeSearchHandler extends SearchRequestHandler
|
|
{
|
|
/**
|
|
* @inheritDoc
|
|
*/
|
|
public function requestClass(): string
|
|
{
|
|
return AnimeSearchCommand::class;
|
|
}
|
|
|
|
protected function renderResponse(LengthAwarePaginator $paginator): AnimeCollection
|
|
{
|
|
return new AnimeCollection($paginator);
|
|
}
|
|
}
|