Level 75
You need to work out a custom lengthaware paginator. What is 'pagination-links' in your code?
Function here any one help me please
public function SubCategory(){
$subcategory = DB::table('subcategories')
->join('categories','subcategories.category_id','categories.id')
->select('subcategories.*','categories.category_en')
->orderBy('id','desc')
->paginate(5);
return view('backend.subcategory.subcategory',compact('subcategory'));
}// end method
view page :
<div class="col-lg-12 grid-margin stretch-card">
<div class="card">
<div class="card-body">
<h4 class="card-title">SubCategory Page</h4>
<div class="template-demo">
<a href="{{ route('add.subcategory') }}"> <button type="button" class="btn btn-primary btn-fw" style="float: right;" >Add SubCategory</button> </a>
</div>
<div class="table-responsive">
<table class="table table-bordered">
<thead>
@php($i = 1)
<tr>
<th> # </th>
<th> Subcategory English</th>
<th> Subcategory Bangla</th>
<th> Category Name</th>
<th> Action </th>
</tr>
</thead>
<tbody>
@foreach ($subcategory as $item)
<tr>
<td> {{ $i++ }} </td>
<td>{{ $item->subcategory_en }} </td>
<td>{{ $item->subcategory_bn }} </td>
<td>{{ $item->category_en }} </td>
<td>
<a href="{{ route('edit.subcategory',$item->id) }}" class="btn btn-info">Edit</a>
<a href="{{ route('delete.subcategory',$item->id) }}" id="delete" class="btn btn-danger">Delete</a>
</td>
</tr>
@endforeach
</tbody>
</table>
{{ $subcategory->links('pagination-links') }}
</div>
</div>
</div>
</div>
@endsection```
Please or to participate in this conversation.