title: Trying to get property 'id' of non-object in laravel 5.6
body: <p>hello i want to know what i am doing wrong that i am getting this error here is my controller and view</p>
  
  <pre><code>$invoice_specs = invoice::find($id);
  $view=view('admin.invoices.pdf',compact('invoice_specs',$invoice_specs));
  </code></pre>
  
  <p>and here is where i have my view</p>
  
  <pre><code>    &lt;table class="table "&gt;
                  &lt;thead&gt;
                  &lt;tr&gt;
                      &lt;th&gt;id&lt;/th&gt;
                      &lt;th&gt;name&lt;/th&gt;
                      &lt;th&gt;description&lt;/th&gt;
                  &lt;/tr&gt;
                  &lt;/thead&gt;
                  &lt;tbody&gt;
                  @foreach($invoice_specs as $invoice_spec)
                      &lt;tr&gt;
                          &lt;td&gt;{{$invoice_spec-&gt;id}}&lt;/td&gt;
                          &lt;td&gt;{{$invoice_spec-&gt;title}}&lt;/td&gt;
                          &lt;td&gt;{{$invoice_spec-&gt;description}}&lt;/td&gt;
                      &lt;/tr&gt;
                  @endforeach
                  &lt;/tbody&gt;
              &lt;/table&gt;
  </code></pre>
  
  <p>and finally here is when i dd $invoice_specs</p>
  
  <pre><code>#attributes: array:5 [▼
  "id" =&gt; 3
  "title" =&gt; "سومین فاکتور"
  "description" =&gt; "سومین فاکتور"
  "created_at" =&gt; "2018-06-12 21:31:57"
  "updated_at" =&gt; "2018-06-12 21:31:57"]
  
  
   #original: array:5 [▼
      "id" =&gt; 3
      "title" =&gt; "سومین فاکتور"
      "description" =&gt; "سومین فاکتور"
      "created_at" =&gt; "2018-06-12 21:31:57"
      "updated_at" =&gt; "2018-06-12 21:31:57"
    ]
  </code></pre>