Im trying to be able to be redirected to the page that the post is on when i select a post from a dropdown list of all my posts.
at the moment i have managed to populate the list with all of the post titles and i have added a link in the form of a to each element in the list but when i click on one of the elements nothing happens.
here is the code i use to populate the list:
<div class="col-md-10">
<select class="form-control" id="post" name="post" required focus>
@foreach($post as $posts)
@if($posts->user_id == Auth::user()->id)
<option value="/posts/{{$posts->id}}" selected>
<a href="/posts/{{$posts->id}}">
{{$posts->title}}
</a>
</option>
@endif
@endforeach
</select>
</div>
the page that i need to be redirected is in the following format:
/posts/id
where the id is the post id
How do i make this work?