title: Passing value from one view to another view by AJAX Post Request in Laravel
body: <p>we can use AJAX Post request to transfer value from view to Controller. I'm doing this and successfully passing value from view to Controller. But can I use AJAX Post request to transfer value from one view to another view? I am doing this as Laravel suggests. But unsuccessful in this. Am I doing something wrong? Please help. Thank you.
  Here is my code: </p>
  
  <p>Page.blade.php:</p>
  
  <pre><code>&lt;script&gt;
      $(document).ready(function(){
              $('a#one').on('click', function () {
              var text=$(this).text();
              console.log(text);
              $.ajax({
                  url: APP_URL+'/show',
                  method: 'post',
                  data: {
                      text: text
                  },
                  success: function(response){
                      console.log(response);
                  }
              });
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>web.php:</p>
  
  <pre><code>Route::post('show','UserController@special');
  Route::get('/show' , [
      'uses' =&gt; 'UserController@special1',
      'as' =&gt; 'show'
  ]);
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>public function special(Request $request){
          $text = $request-&gt;input('text'); 
          echo " dsds ".$text;
          // do stuff with $text
          $projects=DB::table('projects')-&gt;where('projects.type', '=', $text)-&gt;get();
          return view('show',compact('projects'));
      }
  </code></pre>
  
  <p>You can see that I'm using compact function for transferring value to another view named <code>show.blade.php</code>, but it is not transferring value. How can I transfer it to <code>show.blade.php</code>? I know that using <code>GET</code> method one can easily transfer value. But I want to transfer it by using <code>POST</code> request. </p>