mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
18 lines
393 B
PHP
18 lines
393 B
PHP
<?php
|
|
|
|
namespace App\Concerns;
|
|
|
|
use Illuminate\Support\Facades\App;
|
|
|
|
trait ResolvesPaginatorParams
|
|
{
|
|
private function getPaginatorParams(?int $limit = null, ?int $page = null): array
|
|
{
|
|
$default_max_results_per_page = max_results_per_page();
|
|
$limit = $limit ?? $default_max_results_per_page;
|
|
$page = $page ?? 1;
|
|
|
|
return compact("limit", "page");
|
|
}
|
|
}
|