title: Eloquent hasOne relationship Not working laravel 5.4
body: <p>I am trying to keep a relationship between two tables in my database.</p>
  
  <p>Users Table: </p>
  
  <pre><code>Id User_id Name
  </code></pre>
  
  <p>Contacts Table: </p>
  
  <pre><code>Id User_Id contacts
  </code></pre>
  
  <p>I am saving multiple contacts in the contacts table. Now i want to retrieve all the contacts saved to the User_ID. For that, i am trying to establish a hasOne relationship but i get a error for the following code can someone let me know what i am doing wrong? I am following the official documentation for this. </p>
  
  <p>User model: </p>
  
  <pre><code>class users extends Model
  {
     protected $table = "users";
     public function contacts()
      {
          return $this-&gt;hasOne('App\contacts','User_Id');
      }
  }
  </code></pre>
  
  <p>Contacts Model: </p>
  
  <pre><code>class contacts extends Model
  {
      public $table = "contacts";
  
      public function Users(){
          return $this-&gt;belongsTo('App\Users','User_id');
      }
  }
  </code></pre>
  
  <p>Controller: </p>
  
  <pre><code>public function eloquentget(){
  
          $contacts = Users::find(1)-&gt;contacts-&gt;first();
          return response()-&gt;json($contacts,200);
      }
  </code></pre>
  
  <p>When i try this code in postman i get an Exception :</p>
  
  <pre><code>ErrorException
  Trying to get property of non-object
  </code></pre>
  
  <p>What am i doing wrong? Any help will be appreciated. </p>