So, I'm creating a project using laravel and tailwind. After using the paginate() method and then this code in the view
@if ($posts->count())
@foreach ($posts as $post)
<div class="mb-4">
<a class="font-bold" href="">{{ $post->user->name }}</a> <span
class="text-gray-600 text-sm">{{ $post->created_at->diffForHumans() }}</span>
<p class="mb-2">{{ $post->description }}</p>
</div>
@endforeach
{{ $posts->links() }} (this line to create the link to other pages is not working properly)
@else
<p>There are no posts</p>
@endif
The pagination design was a little bizarre. Going to the next and previous page is working correctly.