I am trying to get only one row which is the latest if there is two or more the same jobseeker_id.in my table,
id jobseeker_id type_of_call created_at updated_at
1 0002 incoming call 2017-08-06 16:12:54 2017-08-06 16:12:54
2 0002 outgoing call 2017-09-10 12:12:54 2017-09-10 12:12:54
3 0002 incoming call 2017-10-02 16:12:54 2017-10-02 16:12:54
4 0003 incoming call 2017-08-06 16:12:54 2017-08-06 16:12:54
$jobseekers = DB::table('calllogs')->select('jobseeker_id')->distinct()->get();
var_dump($jobseekers);
but it is returning as only the jobseeker_id column, not including the other columns like type_of_call and created_at and updated_at.And also i want to pull out only the latest rows also.
Any help would be highly appreciated.