title: Take variable outside foreach loop in Laravel
body: <p>I have a query which show information from two tables in foreach loop on my blade view. This is the controller</p>
  
  <pre><code>public function details( $id ){
  
      $details = Item::find($id)-&gt;report;
  
      return view('details', compact('details'));
  } 
  </code></pre>
  
  <p>On my view I have</p>
  
  <pre><code>@foreach($details as $itemDetails)
      ....
  @endforeach 
  </code></pre>
  
  <p>Is it possible to show before foreach single variable from this query like?</p>
  
  <pre><code>{{ $details-&gt;id }}
  
  @foreach($details as $itemDetails)
      ....
  @endforeach 
  </code></pre>
  
  <p>I want to get the $id. </p>