title: Passing data from view to controller in Laravel
body: <p>I understand that passing record ids through the url isn't usually a good idea, but I am wondering how I can avoid it in my case: </p>
  
  <p>My objective is to list job statuses on a user dashboard and allow users to adjust the status.</p>
  
  <p>I create my view and pass variables to it using the session: </p>
  
  <p>userController.php</p>
  
  <pre><code>public function getdashboard()
      {
         //reading the user information
      $arrPageData['user'] = Sentry::getUser();
         //reading the job interviews
      $arrPageData['jobInterviews'] = JobInterview::readCurrentInterviews($this-&gt;userID);
  
      return View::make('clients.dashboard', $arrPageData);
      }
  </code></pre>
  
  <p>This part works great and I don't use the record id in the route. I iterate through the jobInterviews in the dashboard view.  Depending up on the status listed in the DB table, I give the user options </p>
  
  <p>view file: dashboard.blade.php (snippet)</p>
  
  <pre><code>@foreach ($jobInterviews as $interviews)
      @if ($interviews-&gt;j == $job-&gt;id)
          &lt;tbody&gt;
          &lt;tr&gt;
          &lt;td&gt;
          {{$interviews-&gt;contact_name}}
          @if ($interviews-&gt;status == 'interview request accepted')
  
      &lt;a href="#"  class="btn btn-danger btn-small" data-toggle="modal" data-target=".mymodal{{ $interviews-&gt;interview_id }}"&gt;Hire&lt;/a&gt;
         @elseif ($interviews-&gt;status == 'hired')
          &lt;button id="complete" class="btn btn-info btn-small"&gt;Mark Project Complete&lt;/button&gt;
          @endif
          &lt;/td&gt;
          &lt;td&gt;{{$interviews-&gt;status}} &lt;/td&gt;
          &lt;/tr&gt;
          &lt;/tbody&gt;
           ...
  </code></pre>
  
  <p>The problem that I am having is that to complete the job status change, I am calling the method and passing in the record id: </p>
  
  <p>Still in dashboard.blade.php</p>
  
  <pre><code>&lt;form action="../jobs/offer/{{$interviews-&gt;interview_id}}" method="post"&gt;
  </code></pre>
  
  <p>This is then routed through: </p>
  
  <pre><code>Route::post('/jobs/offer/{id}','JobController@jobOffer');
  </code></pre>
  
  <p>Everything works as I want it to but I don't think I am doing it right from a security stand point. Is there a better way to call the jobOffer method and change the status besides using the record id in the route when getting the data from an array i've iterated through?</p>
  
  <p>Thanks in advance for the help.  </p>