Appreciate help on this. The pagination links are not working. The page renders correctly but although the links shows as links, when clicked does not work. My structure is as follows: If I remove the following references in the class file the pagination works but it is not formatted correctly.
use Livewire\WithPagination; use WithPagination;
Class File: AdminDashboardDirectoryCategoryComponent.php
<?php
namespace App\Http\Livewire\Admin;
use App\Models\DirectoryCategory;
use Livewire\Component;
use Livewire\WithPagination;
class AdminDashboardDirectoryCategoryComponent extends Component
{
use WithPagination;
public function render()
{
$dcategories = DirectoryCategory::paginate(9);
return view('livewire.admin.admin-dashboard-directory-category-component',['dcategories'=>$dcategories])->layout('frontend_layout.index2');
}
}
View File: admin-dashboard-directory-category-component.blade.php
style>
nav svg {
height: 20px;
}
nav .hidden {
display: block !important;
}
</style>
<section class="content-central">
<div class="content_info">
<div class="paddings-mini">
<div class="container">
<div class="row portfolioContainer">
<div class="col-md-12">
<table class="table table-striped tester1">
<thead>
<tr>
<th>#</th>
<th>Image</th>
<th>Group</th>
<th>Title</th>
<th>Slug</th>
</thead>
<tbody>
@foreach($dcategories as $dcategory)
<tr>
<td>{{$dcategory->id}}</td>
<td><img src="{{asset('frontend/assets/images/dir_categories')}}/{{$dcategory->category_image}}" width="60" /></td>
<td>{{$dcategory->category_group}}</td>
<td>{{$dcategory->category_title}}</td>
<td>{{$dcategory->category_slug}}</td>
</tr>
@endforeach
</tbody>
</table>
{{$dcategories->links()}}
</div>
</div>
</div>
</div>
</div>
</section>
</body>
</html>