title: How to pass an array value from a method to another method in Laravel?
body: <p>I'm trying to pass the value of an array from one method to another method in Laravel. Basically I have a method called <strong>orderingSubmission</strong> that recieves an array from an Ajax POST execution (that part works fine), but then I'm trying to pass the array values to another method called <strong>orderingSubmissionReceipt</strong> so I can finally render the view on order-summary page. I'm using sessions but they don't seem to work. Can anyone tell me what I'm missing please?</p>
  
  <p><strong>Here's my route.php</strong></p>
  
  <pre><code>Route::get('/', function() { return redirect('home'); });
  Route::get('home', 'HomeController@home');
  Route::post('home', 'HomeController@activateCustomer');
  Route::post('order-summary', 'HomeController@OrderingSubmission');
  Route::get('order-summary', 'HomeController@orderingSubmissionReceipt');
  </code></pre>
  
  <p><strong>HomeController.php</strong></p>
  
  <pre><code>public function orderingSubmission(Request $request)
  {
      $allValues2 = $request-&gt;get('users'); // This code works fine. It gets the array
      Log::info('This is orderingSubmission.....: ' . print_r($allValues2, true));
  
     Session::set('allValues2',$allValues2);
  
  }
  
  public function orderingSubmissionReceipt()
  {
      $allValues3 = Session::get('allValues2'); // This code is not getting the session value
      Log::info('This is orderingSubmissionReceipt.....: ' . print_r($allValues3, true));
  
      return view('order-summary', [
          'people' =&gt; $allValues3
      ]);
  }
  </code></pre>