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

My question stands : Is it wise to store all the transactions in one model.

Here is your answer

Customers have many invoices. Invoices belongs to customers. Accounts have many invoices. Invoices have many accounts.

Last updated 2 years ago.
0

The best way is to create the relationships within the models like nCrazed quoted.

Last updated 2 years ago.
0

Thanks all,

And then use transactions to store it into my database. Will it not be slow if there are let's say 150 transactions in the database.

Roelof

Last updated 2 years ago.
0

Assuming that we are still talking about your data models and not database transactions, no, having 150 items in your database will not make it slow. As long as your database runs on adequate hardware it will handle a considerably larger amount of data without problems.

Last updated 2 years ago.
0

Thanks,

On another site someone suggested that for a financial app I need to inplement a transactional systems. But I cannot find any info how to do something like this in php.

Roelof

Last updated 2 years ago.
0

set MySql to innoDB and read this article :)
http://dev.mysql.com/doc/refman/5.0/en/ansi-diff-transactions.html

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

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.