I'm having a problem saving the data to the database. I can't seem to figure how one-to-many works. So heres the scenario: One journal voucher has many entries in it (debits and credits).
Vouchers Table
| voucher_id(pk) | voucherNo | notes | amount | date |
Entries Table
| entry_id(pk) | voucher_id(fk) accountname | description | debit | credit |
EntriesTable
$this->belongsTo('Vouchers', [
'foreignKey' => 'voucher_id',
'joinType' => 'INNER'
]);