Also in console i see this http://127.0.0.1:8000/livewire/update 404 (Not Found)
i'm using localization and according to the doc, it has stopped supporting this automatically unlike livewire 2
https://livewire.laravel.com/docs/upgrading#localization:~:text=%23-,Localization,-If%20your%20application
Aug 8, 2024
2
Level 5
Pagination not working with livewire 3
Hi,
Pagination is not working after upgrading to livewire 3, i got the this error : ``` http://127.0.0.1:8000/en/blog?page=2 `` Page not found
In BlogList component
use Livewire\Component;
use Livewire\WithPagination;
use App\Models\Blog;
use Hashids\Hashids;
class BlogList extends Component
{
use WithPagination;
protected $paginationTheme = 'bootstrap';
public function render()
{
$hash = new Hashids('', 10); // pad to length 10
$blogs = Blog::paginate(6);
return view('livewire.blog-list',compact('blogs','hash'));
}
}
In blog-list view blade
<div>
<!-- Blog -->
<section class="blog-area three ptb-100">
<div class="container">
<div class="row">
<div class="col-12">
<div class="row">
@if($blogs && $blogs-> count() > 0)
@foreach ($blogs as $blog)
<div class="col-md-6 col-sm-6 col-lg-4">
<div class="blog-item">
<div class="top">
<a target="_blank" href="{{ $blog->photo}}">
<img src="{{ $blog->photo}}" alt="blog" style="width: 510; height:450" title="{{ $blog->title}}" alt="{{ $blog->title}}">
</a>
</div>
<div class="bottom">
<ul>
<li>
<i class="icofont-calendar"></i>
<span>{{ Date::parse($blog->created_at) ? Date::parse($blog->created_at)->diffForHumans() : ''}}</span>
</li>
<li>
<i class="icofont-user-alt-3"></i>
<span>{{ trans('front/message.By') }}:</span>
<a href="#">{{ $blog->user->name}}</a>
</li>
</ul>
<h3>
<a href="{{ url('blog/details/'.str_replace_me($blog->title).'/'.$hash->encodeHex($blog->id))}}" title="{{ $blog->title}}">{{ $blog->title}}</a>
</h3>
<p>{{ $blog->short_description }}</p>
<a class="blog-btn" href="{{ url('blog/details/'.str_replace_me($blog->title).'/'.$hash->encodeHex($blog->id))}}" title="{{ $blog->title}}">{{ trans('front/message.Read More') }}</a>
</div>
</div>
</div>
@endforeach
@endif
</div>
<div class="pagination-area">
<ul>
<li>
{{ $blogs->links() }}
</li>
</ul>
</div>
</div>
</div>
</div>
</section>
<!-- End Blog -->
</div>
Any idea what is going wrong pls ? Thanks
Level 5
I added this to my route, its working now but it takes like 4 second to render from one page to another
Livewire::setUpdateRoute(function ($handle) {
return Route::post('/livewire/update', $handle);
}); ```
1 like
Please or to participate in this conversation.