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.
The best way is to create the relationships within the models like nCrazed quoted.
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
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.
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
set MySql to innoDB and read this article :)
http://dev.mysql.com/doc/refman/5.0/en/ansi-diff-transactions.html
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community