Reputation: 429
I keep on getting this error method with does not exist and I have no idea how to fix it. I saw people who posted similar question like this and it usually the fault of all() but I am not using it. Can anyone help?
controller:
public function getPerson(){
return view('show');
}
public function getInfo($id) {
$user_info1 = user_info1::where('user_id',$id)->get();
$data['data'] = DB::table('personal_infos')::with('userinfo1s')->get()->sortByDesc('upload_time'); //error come from this line
return view('test', compact('user_info1','data'));
}
Upvotes: 0
Views: 1091
Reputation: 9117
sortByDesc is in collection laravel.. use orderby instead
$data['data'] = PersonalInfos::with('userinfo1s')->orderby('upload_time')->get();
Upvotes: 0