$udata = DB::table('student_info')
->join('student_academy', 'student_info.student_id', '=', 'student_academy.student_id')
->where('student_info.student_id', $id)
->where('student_academy.student_id', $id)
->get();
dd($udata); ---> Here is ok. and i tried 3 way:
return view('pages.student.editStudent', compact('udata'));
return view('pages.student.editStudent', ['udata'=> $udata]);
return view('pages.student.editStudent')->with('udata', $udata );
But every time Display this error
(2/2) ErrorException Property [s_name] does not exist on this collection instance.
where is my mistake ??
try this way..
@foreach($udata as $data)
{{$data->s_name}}
@endforeach
or
{{$udata[0]->s_name}}
改用{{udata[0]['s_name']}}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.