I am updating a system that is developed in pure PHP and I am putting it in Laravel, however, I had never done more than one join and with "AND" parameters so I would like to be helped, how can I put this SELECT in the controller Laravel?
<?php
$users = "SELECT * FROM ma_usuario u, ma_user_tipo t, ma_user_tipo_rel r
WHERE ma_user_tipo.tp_usr_id=ma_user_tipo_rel.tp_usr_id
AND ma_usuario.usr_id=ma_user_tipo_rel.usr_id
AND ma_usuario.usr_status='Ativo'
AND r.tp_usr_id='$id'
ORDER BY u.usr_id";
?>
As many parameters have had a knot in the brain and I did not understand how to mount.