I have a query that I have tried to sort by relationship. Firstly this has not sorted all the results by engineer. Also how do I paginate the result?
$qualification_list = Qualification::with('engineer', 'course')->get()->sortBy('engineer.name');
I have tried ->paginate(15); at the end and also
$qualifications = $qualification_list->paginate(15);
Please help me sort by the relationship and then paginate the result..