I am trying to use Pagination functionality provided by Laravel. Functionality works correctly for 1st page. However, pagination is not working for subsequent pages.
It is raising an error "Array to String Conversion" while echoing $tableData. Below is my code snippet of view.
<tbody>
@foreach ($tableData as $d)
<tr>
<td></td>
<td>{{$d->ItemMake}}</td>
<td>{{$d->Item}}</td>
<td>{{$d->style}}</td>
<td>{{$d->Price}}</td>
<td>{{$d->ItemValue}}</td>
</tr>
@endforeach
<tr>
<td>
<?php
echo $tableData;
?>
</td>
</tr>
</tbody>
while using "{{$tableData}}" , its throwing the error, Error : "htmlentities() expects parameter 1 to be string, array given"
while using "{!! $tableData !!}" , its throwing the error, Error : Array to string conversion
$tableDatais a Query builder with Pagination applied($query->paginate(10)) then you can userendermethod to draw pagination like this{!! $tableData->render() !!}and the error is not because of Pagination, it's because you are trying to print an Array with Blade Engine.