title: Laravel - Get items from session array
body: <p>I'm making a step program and therefore I wanted to use sessions. I have a form which allows the user to fill in some information and then the input values will be put in a session array called "basic_settins" like this</p>
  
  <pre><code>public function saveSettings(Request $request, Product $products)
  {
      $request-&gt;session()-&gt;push('basic_settings', $request-&gt;input());
  
  
      return redirect('/themes');
  }
  </code></pre>
  
  <p>But how can I get a specific item from that array and display it for instance in my view? By using something like this: <code>{{ Session::get('store_name') }}</code> in an input field.</p>
  
  <p>The view looks like this:</p>
  
  <pre><code>@extends('layouts.app')
  
  @section('content')
  &lt;div class="container"&gt;
      &lt;div class="row"&gt;
          &lt;div class="col-md-12"&gt;
              &lt;form method="POST" action="{{ route('saveBasicSettings') }}"&gt;
                  &lt;div class="row"&gt;
                      &lt;div class="col-md-12"&gt;
                          &lt;button class="btn btn-primary mb-3 float-right"&gt;Next&lt;/button&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
  
                  &lt;div class="card z-depth-2" style="border-radius: 7px;"&gt;
                      &lt;div class="card-body"&gt;
                          &lt;input type="hidden" name="user_id" value="{{ Auth::user()-&gt;id }}"&gt;
                          {{ csrf_field() }}
                          &lt;div class="form-group"&gt;
                              &lt;label for="store_name"&gt;Store name&lt;/label&gt;
                              &lt;input type="text" class="form-control" placeholder="Store name" id="store_name" name="store_name" value="{{ Session::get('store_name') }}" required&gt;
  
                          &lt;/div&gt;
                          &lt;div class="form-group"&gt;
                              &lt;label for="company name"&gt;Company name&lt;/label&gt;
                              &lt;input type="text" class="form-control" placeholder="Company name" id="company_name" name="company_name" value="{{ Session::get('company_name') }}" required&gt;
  
                          &lt;/div&gt;
                          &lt;div class="form-group"&gt;
                              &lt;label for="company_tel"&gt;Company phonenumber&lt;/label&gt;
                              &lt;input type="text" class="form-control" placeholder="Company Phonenumber" id="company_tel" name="company_tel" value="{{ Session::get('company_tel') }}" required&gt;
  
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/form&gt;
          &lt;/div&gt;
  
      &lt;/div&gt;
  &lt;/div&gt;
  @endsection
  </code></pre>
  
  <p>When I dd the request by doing this: <code>$data = $request-&gt;session()-&gt;all();</code> and then <code>dd($data);</code></p>
  
  <p>I get the following result:</p>
  
  <p><a href="https://i.stack.imgur.com/dHeBX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dHeBX.png" alt="enter image description here"></a></p>
  
  <p>How can I make this work? Thanks in advance!</p>