0
I have a collaborators table, and other 2 activity tables, each with a column of time used to perform that activity and I would like to add these tables to know the total time, example, employee A did 10 hours in a project (table 1) and another 10 hours in parallel activities (Table 2), add the two and stay 20 hours.
I’m using Laravel, my question is how to do this using the Eloquent ORM. I’m a little stuck in logic, need to use relationship Many to Many? do you have any example? I thank you.
Opa Carlos!? Put the structure of the tables you want to make the relationship. This way the people will have greater vision to help you
– Walmir Silva
Ready Walmir, it is not exactly the name of the fields, but the structure is the same.
– Carlos Eduardo Silva
Are you trying to add tempo_atv_proj with tempo_atv_ext of a certain coladorador_id? you created the Eloquent classes?
– novic
This Virgilio, I want to add these columns of time, I created only the models of each haha, nothing else.
– Carlos Eduardo Silva
@Carloseduardosilva if you can put these
models
?– novic