$params * * @return LengthAwarePaginator */ public function handle(Api $api, int $page, array $params): LengthAwarePaginator { return $api->pageSearch($params, $page, 10); } /** * @return array */ public function rules(): array { return [ 'mglnr' => 'required|numeric|min:0', 'password' => 'required|string', 'params' => 'array', ]; } /** * @return LengthAwarePaginator */ public function asController(ActionRequest $request): LengthAwarePaginator { $api = Nami::login($request->input('mglnr'), $request->input('password')); return $this->handle($api, $request->input('page', 1), $request->input('params')); } }