title: How to update item in session array in laravel
body: <p>I need update 1 item of my session , i send a new quantity from my form, <code>$item['quantity']</code> change but not <code>Session::get('details_evacuation_file')</code></p>
  
  <p>It's the structure</p>
  
  <pre class="lang-php prettyprint-override"><code>    Session::push('details_evacuation_file', [
                    'id' =&gt; $p_temp-&gt;id,
                    'quantity' =&gt; 1,
                    'cost' =&gt; null,
                    'discount' =&gt; 0,
                    'product' =&gt; $p_temp  
                  ]);
  </code></pre>
  
  <p>My function</p>
  
  <pre class="lang-php prettyprint-override"><code>    public function update_quantity(Request $request) {
             $details = Session::get('details_evacuation_file', []);
              foreach ($details as $item) {
                  if ($item['id'] == $request-&gt;input('id')) {
                      var_dump($item['quantity']); 
                      $item['quantity'] = $request-&gt;input('quantity');
                      var_dump($request-&gt;input('quantity')); 
                      var_dump($item['quantity']);  
                  }
              }
             session('details_evacuation_file', $details );
             var_dump(Session::get('details_evacuation_file'));
             die();
             return redirect()-&gt;back();
          }
  </code></pre>