Custom pagination clsss
philkobby opened this issue · 1 comments
philkobby commented
Scribe version
4.37
Your question
Hi, I have a custom pagination class that extends Illuminate\Pagination\LengthAwarePaginator
, and it's been bound in the service container. This works fine with the paginate()
method. However, Scribe seems to instantiate the Illuminate\Pagination\LengthAwarePaginator
class directly, which overrides the custom pagination class when generating documentation.
#[ResponseFromApiResource(
TaskCollection::class,
Task::class,
paginate: 15,
status: 200,
description: 'Request was successful',
collection: true,
)]
public function index(Request $request)
{
return new TaskCollection(Task::paginate(15));
//paginations are generated as expected but the documentation does not follow the same format as expected
}
Is there a workaround for Scribe to resolve the custom pagination class instead of Illuminate\Pagination\LengthAwarePaginator?
Docs
- I've checked the docs, the troubleshooting guide, and existing issues, but I didn't find a solution
shalvah commented
I guess we could change it to go through the service container. PR welcome!