title: Laravel not returning correct foreign key after updating the object
body: <p><a href="https://i.stack.imgur.com/CJv0l.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CJv0l.png" alt="enter image description here"></a></p>
  
  <p>The above code is generated like this:</p>
  
  <pre><code>$post = Post::findOrFail($postId);
  
  echo "category id: " . $post-&gt;category-&gt;id."&lt;br /&gt;";
  echo "category name: ". $post-&gt;category-&gt;name;
  dd($post);
  exit;
  </code></pre>
  
  <p><strong>Post model</strong>:</p>
  
  <pre><code>class Post extends Model
  {
     protected $table = 'posts';
  
     public function category() {
        return $this-&gt;hasOne(Category::class, 'id');
     }
  }
  </code></pre>
  
  <p><strong>Category model</strong>:</p>
  
  <pre><code>class Category extends Model
  {
     protected $table = 'categories';
  }
  </code></pre>
  
  <p>The migration and the database seeding went well, however after updating the <code>Post</code> entry the foreign key value isn't changed.</p>
  
  <p><strong>Migration</strong>:</p>
  
  <pre><code>public function up()
  {
      Schema::create('posts', function (Blueprint $t) {
          $t-&gt;bigIncrements('id');
          $t-&gt;timestamps();
          $t-&gt;unsignedBigInteger('category_id');
          $t-&gt;foreign('category_id')
                  -&gt;references('id')-&gt;on('categories')
                  -&gt;onDelete('cascade');
          $t-&gt;string('title', 255);
          $t-&gt;string('description', 255);
      });
  }
  </code></pre>
  
  <p><strong>Updating the entry</strong>:</p>
  
  <pre><code>$post_id = $data-&gt;post_id;
  $category_id = $data-&gt;category_id;
  $title = $data-&gt;title;
  $description = $data-&gt;description;
  
  $post = Post::where('id', $post_id)-&gt;first();
  
  $post-&gt;category_id = $category_id;
  $post-&gt;title = $title;
  $post-&gt;description = $description;
  
  $post-&gt;save();
  </code></pre>
  
  <p>I've checked the database, the entry is updated (even the foreign key), however after getting the <code>$post-&gt;category-&gt;id</code> is giving me the old value.</p>
  
  <p>Here is a screenshot from the database:</p>
  
  <p><a href="https://i.stack.imgur.com/pD1I9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pD1I9.png" alt="enter image description here"></a></p>
  
  <p><strong>Update</strong>
  It looks like when printing out the <code>$post-&gt;category-&gt;id</code> it's showing me the post's id instead of the category id.</p>