title: Call to undefined method Illuminate\Database\Eloquent\Relations\BelongsTo::save()
body: <p>I want to insert data into multiple tables (one to one), but i get error and in my database the column &quot;metode_id&quot; is null. i want the &quot;metode_id&quot; is not null</p>
  <p>this is class &quot;Transaksi&quot; :</p>
  <pre><code>class Transaksi extends Model
  {
      protected $table = &quot;transaksi&quot;;
      protected $primarykey = &quot;id&quot;;
      protected $fillable = ['stok_kedelai', 'stok_ragi', 'harga_kedelai', 'harga_ragi'];
  
      public function metode()
      {
          return $this-&gt;belongsTo('App\Metode');
      }
  public function pengguna()
      {
          return $this-&gt;belongsTo('App\Pengguna');
      }
  }
  </code></pre>
  <p>This is class &quot;Metode&quot; :</p>
  <pre><code>class Metode extends Model
  {
      protected $table = &quot;metode&quot;;
      protected $primarykey = &quot;id&quot;;
      protected $fillable = ['bni', 'bri', 'mandiri', 'bca', 'btpn', 'ovo', 'gopay', 'dana'];
  
      public function transaksi()
      {
          return $this-&gt;hasOne('App\Transaksi', 'metode_id');
      }
  }
  </code></pre>
  <p>This is database of &quot;Transaksi&quot; :</p>
  <pre><code>public function up()
  {
      Schema::create('transaksi', function (Blueprint $table) {
          $table-&gt;bigIncrements('id');
          $table-&gt;bigInteger('pengguna_id')-&gt;unsigned();
          $table-&gt;integer('stok_kedelai');
          $table-&gt;integer('stok_ragi');
          $table-&gt;integer('harga_kedelai');
          $table-&gt;integer('harga_ragi');
          $table-&gt;bigInteger('metode_id')-&gt;unsigned();
          $table-&gt;timestamps();
      });
  
      Schema::table('transaksi', function (Blueprint $table) {
        $table-&gt;foreign('pengguna_id')-&gt;references('id')-&gt;on('pengguna')-&gt;onDelete('cascade')-&gt;onUpdate('cascade');
      });
  
      Schema::table('transaksi', function (Blueprint $table) {
        $table-&gt;foreign('metode_id')-&gt;references('id')-&gt;on('metode')-&gt;onDelete('cascade')-&gt;onUpdate('cascade');
      });
  }
  </code></pre>
  <p>This is database of &quot;Metode&quot; :</p>
  <pre><code>public function up()
  {
      Schema::create('metode', function (Blueprint $table) {
          $table-&gt;bigIncrements('id');
          $table-&gt;integer('bni')-&gt;nullable();
          $table-&gt;integer('bri')-&gt;nullable();
          $table-&gt;integer('mandiri')-&gt;nullable();
          $table-&gt;integer('bca')-&gt;nullable();
          $table-&gt;integer('btpn')-&gt;nullable();
          $table-&gt;integer('ovo')-&gt;nullable();
          $table-&gt;integer('gopay')-&gt;nullable();
          $table-&gt;integer('dana')-&gt;nullable();
          $table-&gt;timestamps();
      });
  }
  </code></pre>
  <p>i want insert data into mutiple table that which depends on the &quot;id&quot; of pengguna table but i get error Call to undefined method Illuminate\Database\Eloquent\Relations\BelongsTo::save()</p>
  <pre><code>public function data_penjualan(Request $request)
  {
      $pengguna = Pengguna::where('id', Auth::user()-&gt;id)-&gt;first();
  
      $transaksi = new Transaksi();
      $transaksi-&gt;stok_kedelai    = $request-&gt;stok_kedelai;
      $transaksi-&gt;stok_ragi       = $request-&gt;stok_ragi;
      $transaksi-&gt;harga_kedelai   = $request-&gt;harga_kedelai;
      $transaksi-&gt;harga_ragi      = $request-&gt;harga_ragi;
      $pengguna-&gt;transaksi()-&gt;save($transaksi);
  
      $metode = new Metode();
      $metode-&gt;bni = $request-&gt;bni;
  
      $transaksi-&gt;metode()-&gt;save($metode);
  
      return view('transaksi.supplier', compact('transaksi'));
  }
  </code></pre>
  <p>this is my database, the &quot;metode_id&quot; get null, how i want that &quot;metode_id&quot; is not null :
  <a href="https://i.stack.imgur.com/Svhk4.png" rel="nofollow noreferrer">enter image description here</a></p>