title: Trying to get property of non-object Laravel 5.5
body: <p>I'm trying to echo out the name of the user in my article and I'm getting the </p>
  
  <pre><code>ErrorException: Trying to get property of non-object.
  </code></pre>
  
  <p>My codes:</p>
  
  <p><b>Offer Model</b></p>
  
  <pre><code>class Offer extends Model
  {
      public function countries()
      {
          return $this-&gt;belongsTo(Country::class, 'country_id');    
      }
  }
  </code></pre>
  
  <p><b>Country Model</b>    </p>
  
  <pre><code>class Country extends Model
  {
      public function offers()
      {
          return $this-&gt;hasMany(Offer::class);
      }
  }
  </code></pre>
  
  <p><b>index.blade</b></p>
  
  <pre><code>{{ $offer-&gt;countries-&gt;name }}
  </code></pre>
  
  <p><b>OfferController</b></p>
  
  <pre><code>public function index()
  {
      $offers = Offer::latest()-&gt;paginate(5);
      return view('admin.offers.index', compact('offers'))
  </code></pre>
  
  <p>when  I<code>dd($offer-&gt;first()-&gt;countries)</code> the result is null.</p>