title: dompdf not loading data vo view Laravel
body: <p>I'm trying to convert html page to pdf using dompdf wrapper in laravel. If I show the html page, the informations from database are displayed on the page, but when I try to convert that to pdf I have only empty div tags without values from the database.</p>
  
  <p>This is my code for converting pdf:</p>
  
  <pre><code>public function viewUserOrderDetails($id){
          $user = User::find($id);
  
          $pdf = PDF::loadView('userOrderDetails',['user' =&gt; $user]);
          return $pdf-&gt;stream("index.pdf");
      }
  </code></pre>
  
  <p>and the route function:</p>
  
  <pre><code>    Route::post('/userOrderDetails/{id}',[
     'uses' =&gt; 'showAllOrders@viewUserOrderDetails',
     'as' =&gt; 'orderdetail',
  ]);
  </code></pre>
  
  <p>View sample code:</p>
  
  <pre><code>&lt;div class="container"&gt;
      &lt;form class="form-horizontal" method="POST"&gt;
    &lt;fieldset&gt;
      &lt;div class="col-lg-12 form-group margin50"&gt;
        &lt;label class="col-lg-2"  for="Name"&gt;User&lt;/label&gt;
        &lt;div class="col-lg-4"&gt;
            &lt;input type="hidden" name="_token" value="{{ csrf_token() }}"&gt;
            &lt;input type="text" id="name" name="Name" placeholder="" class="form-control name" value="{{ $user-&gt;name }}" readonly&gt;
            {{ csrf_field() }}
        &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class=" col-lg-12 form-group"&gt;
        &lt;label class="col-lg-2" for="ProductType"&gt;Orders&lt;/label&gt;
        &lt;div class="col-lg-4"&gt;
           @foreach($user-&gt;orders as $order)
              &lt;input type="text" placeholder="" class="form-control name" value="{{ $order-&gt;order_name }}" readonly&gt;
           @endforeach
        &lt;/div&gt;
      &lt;/div&gt;
       &lt;div class="col-lg-12 form-group"&gt;
        &lt;label class="col-lg-2" for="Manufacturer"&gt;Price&lt;/label&gt;
        &lt;div class="col-lg-4"&gt;
          @foreach($user-&gt;orders as $order)
              &lt;input type="text" placeholder="" class="form-control name" value="{{ $order-&gt;cena }}" readonly&gt;
           @endforeach
        &lt;/div&gt;
      &lt;/div&gt;
     &lt;/div&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>Also if i try to change <code>$pdf = PDF::loadView('userOrderDetails',['user' =&gt; $user]);</code> to this 
  <code>$pdf = PDF::loadView('userOrderDetails',compact('user'));</code> it gives me <code>user not found error</code></p>
  
  <p>Any ideas?</p>