Hello, please help me.
I created a controller, I pulled some data from the DB, when I pass the data to the view I get this error : Undefined variable $member
MembersController :
public function member(Request $request){
$member = DB::table('members')->where('id', $request->query('m'))->first();
//dd($member);
return view('members.member',['member',$member]);
}
routes/web.php :
Route::prefix('members')->group(function () {
Route::get('create', [MembersController::class, 'create']);
Route::get('member', [MembersController::class, 'member']);
});
views/members/member.blade.php
{{ $member->id }}
Please help me.
No problem. Feel free to let us know if you need help.
Thanks
Hi alx naxis
Please try to fix this part
return view("members.member",["member" => $member]);
thank you. Solved.