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
32 lines
668 B
PHP
32 lines
668 B
PHP
<?php
|
|
|
|
namespace App\Features;
|
|
|
|
use App\Dto\MangaSearchCommand;
|
|
use App\Enums\MangaOrderByEnum;
|
|
use App\Http\Resources\V4\MangaCollection;
|
|
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
|
use Illuminate\Support\Collection;
|
|
|
|
/**
|
|
* @extends SearchRequestHandler<MangaSearchCommand, MangaCollection>
|
|
*/
|
|
class MangaSearchHandler extends SearchRequestHandler
|
|
{
|
|
/**
|
|
* @inheritDoc
|
|
*/
|
|
public function requestClass(): string
|
|
{
|
|
return MangaSearchCommand::class;
|
|
}
|
|
|
|
/**
|
|
* @inheritDoc
|
|
*/
|
|
protected function renderResponse(LengthAwarePaginator $paginator)
|
|
{
|
|
return new MangaCollection($paginator);
|
|
}
|
|
}
|