title: Sending variable to controller from a view
body: <p>I am in this kind of situation</p>
  
  <p>I have a controller where I am redirecting,as I need a certain code to proceed</p>
  
  <pre><code> if(isset($code))
          {
              return back()-&gt;with('getCode', ' ');
  </code></pre>
  
  <p>And in my view, I am passing a form to get that value</p>
  
  <pre><code>@if(session('getCode')) 
    &lt;form action=""&gt;
    &lt;input type="text" name="confirmationcode"&gt; 
    &lt;/form&gt; 
  @endif
  </code></pre>
  
  <p>Now in this controller, I want to access this confirmation code immediately </p>
  
  <pre><code>if(isset($code))
          {
              return back()-&gt;with('getCode', ' ');
              $code = request('confirmationcode');
              $business-&gt;book($code);
  </code></pre>
  
  <p>Since the logic <code>if(isset($code))</code> takes place after lots of coding, I don't want to go through start of the controller again. </p>
  
  <p>Is there a way to access the <code>request('confirmationcode')</code> immediately from that view?</p>