This could be helpful - https://laracasts.com/series/mysql-database-design/episodes/7
But then again - do you want to do a simple join in the above query so its a raw query with join or would you like to utilize joins provided by eloquent ?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello.
I'm trying to update some old code we have.
I need to rewrite the following query:
SELECT DISTINCT tblclients.id,tblclients.firstname,tblclients.lastname FROM tblclients, tblhosting WHERE tblclients.status="Active" AND tblclients.id=userid AND tblhosting.domainstatus="Active" AND tblhosting.server=1
I'm a newb at MySQL, so this is a difficult problem for me. I've heard about joins and guess I might need to use that, but at the moment I'm stuck trying to figure out how.
Please or to participate in this conversation.