1
Hello. I have a small model attached here. My task is from users, to get the records of Orders that have some record in the payment with the id of that order and the id of that user. Basically, an order can have several payments, which has the order_id and the user_id. and I want to access in my controller $user->Orders. I have tried the relationship hasManyThrough, I did not get results. I would need to create a pivot table to supply my problem?
because in the
payments
you didn’t putvoucher_id
? That is the name of the convention, of course another name works is that it leaves the standard. Cade its relations and its classes?– novic
Puts the models
– Thiago Moreira