i have a strange problem here which i never had any issues until now
when you paginate results and when you click the next page it should return the next results
but when i click the next page it just reloads the same page, meaning it displays the same results
this is my route
Route::group(['prefix' => 'videos'], function () {
Route::get('/', 'VideosController@allVideos');
Route::get('all', 'VideosController@allVideos')->name('videos.all');
});
and this is my VideosController
public function allVideos()
{
$video = Video::paginate(12);
return view('frontend.videos.index')
->with('video', $video)
->with('title', 'All Videos');
}
and this is my view
<div class="col-md-9 col-sm-8">
<div id="result-video-filter-page">
<div class="row">
@foreach($video as $result)
<div class="col-sm-6 col-md-4 col-lg-4">
<div class="well well-sm well-shadow">
<a href="{{ url('watch')}}/{{$result->string_id.'/'.$result->post_name}}">
<span class="thumb-overlay">
<img src="{{$result->getImageUrl($result->poster)}}" alt="{{$result->title_name}}" class="img-responsive ">
<div class="hd-text-icon">HD</div>
<span class="duration">{{sec2hms($result->duration)}}</span>
</span>
<span class="video-detail">
<span class="video-title title-truncate m-t-5">{{$result->title_name}}</span>
<span class="video-views pull-left">{{ $result->created_at->diffForHumans() }}</span>
</span>
</a>
<div class="clearfix"></div>
</div>
</div>
@endforeach
</div>
<div class="page_navigation">
{{ $video->links() }}
</div>
</div>
</div>
so why is this not working ?
im using laravel since version 4 and i had never an issue using pagination
btw im using laravel 5.4.18 and did not test this on previous version