Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 2 years ago.
0

Hi Darius,

The get function returns a collection of result please try using first() for more details have a look at the Query Builder Manual

You might also have a look at eloquent and how relations work

I would create 2 Elqouent Models "Cashbook" and "transactions" and then set up a one to many relation ( A Cashbook has many transactions and a transaction belongs to one cashbook) or have two relations one for the receiving cashbook and one for the sending cashbook

Eloquent Getting started

Eloquent Relationships : one to many

Last updated 5 years ago.
0

Thanks Taftse! I have made a note in my todo-list. Currently I do not have relations setup correctly. Once I fix this probably I will be able to make this work more easily. I will try to not forget and report back here on the result and approach I have taken.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Darius Blaszyk daar Joined 21 Aug 2019

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.