To use the onEachSide() feature with Breeze/Vue and Inertia, you can pass the onEachSide() method as a parameter to the links() method in the controller. Here's an example:
$posts = Post::paginate(10)->onEachSide(3);
return Inertia::render('Posts/Index', [
'posts' => $posts,
'links' => $posts->links('vendor.pagination.default', [
'onEachSide' => 3,
])->toHtml(),
]);
In the above example, we're calling the paginate() method with a limit of 10 and then chaining the onEachSide() method to set the number of links to show on each side of the current page. We then pass the $posts variable and the pagination links to the Inertia view. In the view, we can render the pagination links using the v-html directive:
<div v-html="links"></div>