I have two tables Parameters
and Share_Details
. I have my raw SQL query here and I want to write it in pure Eloquent way. please help.
$shareDetails=DB::select ("SELECT s.id, share_type, para_int_1, para_int_2, price, para_name FROM share_details as s,parameters where para_type='share' and para_id=share_type and startDate=(select max(startdate) from share_details where share_type=s.share_type) group by share_type, s.id, para_int_1, para_int_2, price, para_name");
Try something like this: