I am trying to paginate a Eloquent relationship like this:
$query = Product::find(1)->options()->paginate();
But I get the following
Create a custom length-aware paginator.
$options = new LengthAwarePaginator(Product::find(1)->options()-> ->skip(($request->input('page', 1) - 1) * 10)->take(10)->get(), Product::find(1)->options()->count(), 10, $request->input('page', 1), [ // paginator options here ]);