Compare a column of an Array with 1 row in another table using Laravel 5.7

1

I hope I can explain in the best way I am developing a project in Laravel 5.7 and I have a problem which I describe below:

I have the statusprestamos table

id | idprestamo | totalprestamo  | status
1       1             500          pendiente pago
2       1             500          pendiente pago
3       1             500          pendiente pago
4       2            1000          Pagado
5       2            1000          pendiente pago
6       2            1000          pendiente pago

Obviously the idprestamo column is linked to the loans table

id  | nombre |  
1       Juan
2      Pedro
3      Isabel
4      Luis

What I need is that I have a page where I show the run of the table status loans with which I have no problem, the problem is that I want to find me in the IDPRESTAMO and compare it with the ID column of the table loans, and show me only that result that would be the name of the person

Client: {{$ loans-> name}}

asked by Beto A. Lien 20.10.2018 в 20:51
source

0 answers