I'm using Laravel 5.0 and paginate along with the render()
function in my view. Rather than go back to the top of the screen after I select the next page I want it to jump to #msgs
.
Here is some of my code:
<h1 class="centered" id="msgs">Announcements</h1>
@foreach($messages->getCollection()->all() as $message)
<div class="row">
<div class="row">
<div class="col-sm-9">
<h3>{{$message->title}}</h3>
</div>
<div class="col-sm-3">
<h4>From: {{$message->author_name}}</h4>
</div>
</div>
<div class="row">
<p>{{$message->text}}</p>
</div>
</div>
<hr class="featurette-divider">
@endforeach
<div class="centered">
{!! $messages->render() !!}
</div>
I'm still getting a grasp on the flow of things in laravel so I'm not really sure what to do. I tried to use append->('#msgs')
but realized that its appending an array in the parameters, not appending a path to the url. I there a simple way to achieve this without overriding anything?