Reputation: 684
View
$aHotelRooms = DB::table('abserve_hotels')->paginate(3);
@foreach($aHotelRooms as $aHotelRoom)
@endforeach
<div class="pagination">
<?php
echo $aHotelRooms->appends('aHotelRooms')->render();
?>
Here pagination shows the lists according to what I gave in paginate()
..
But when I click the links in that pagination..It seems to be an Object not found
404 error
..
What should I do for this..
Regards Suganya,
Upvotes: 0
Views: 268
Reputation: 9444
When using xampp
you can proceed like the following:
{!! $aHotelRooms->path('')->appends('aHotelRooms')->render() !!}
If path('')
doesn't work, you can also try path('/')
.
I always had to use this hack in xampp
.
Upvotes: 1
Reputation: 5042
Try this:
$aHotelRooms = DB::table('abserve_hotels')->simplePaginate(15);
<div class="container">
@foreach ($aHotelRooms as $rooms)
{{ $rooms->name //define here what you need }}
@endforeach
</div>
{!! $aHotelRooms->links() !!}
I am new to laravel. Hope this helps you...!!
Upvotes: 0
Reputation: 163748
You have wrong Laravel settings. You should point your web server (for example, Apache) to the public
directory which is inside you Laravel project's root directory. That's why your links are broken.
For example, if your Sugan
directory is in c:\MySites\
, you must set up c:\MySites\Sugan\travelz\public
directory as root directory.
Update
To chage root directory in XAMPP:
Upvotes: 1