In my blade I have field called $jobs
. I am trying give every single form a unique url based on the $job->id
. So the url is jobs/$job->id. However when I click on the a tag for to submit the form all the urls show jobs/the last $job->id. In my case all the urls show job/386
. What should I so every url has a unique url? Here is my code.
@foreach($jobs as $job)
<form method="post" action="{{url('jobs/'. $job->id)}}" id="start-jobs">
{{csrf_field()}}
<a onclick="document.getElementById('start-jobs').submit()">( start )</a>
</form>
@endforeach