Level 1
What do you mean "so that i can use relations" ? You must have a model instance to use a relationship.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
select ed.*,pr.punch_in,pr.punch_out,pr.date,roster.week_off from (select * FROM employeedetails WHERE status = 'Active') as ed LEFT JOIN (SELECT * FROM `punchreports` where date = '".$currentDate."') as pr on ed.emp_id = pr.emp_id LEFT JOIN (SELECT * FROM rosters WHERE month='December' AND year='2018') as roster on ed.emp_id = roster.emp_id
How to convert this query to eloquent statement so that i can use relations.
Please or to participate in this conversation.