How to convert this sql query to Eloquent ?
SELECT user_id, company_id, MAX(date) date
FROM careers
GROUP BY user_id, comapany_id;
`
How to convert this sql query to Eloquent ?
SELECT user_id, company_id, MAX(date) date
FROM careers
GROUP BY user_id, comapany_id;
`
For further actions, you may consider blocking this person and/or reporting abuse
Giuliano1993 -
Mahfuzur Rahman -
Nasrul Hazim Bin Mohamad -
Saddam Hossain -
Top comments (2)
I just made a tool just for this. You can use it for free:
jjlabajo.github.io/SQLtoEloquent/
$careers = Career::selectRaw('user_id, company_id, MAX(date) as date')->groupBy(['user_id','comapany_id'])->get();