it cant be calling this controller?
Sep 8, 2022
7
Level 15
Why does my controller divert to a different view?
I have two views, one called 'manualRegistration', the other called 'newManualRegistration.
I enter a date into the first one. JS grabs it passes onto Axios. Axios calls the controller below:
public function getRegistration(Request $request){
$registeredChildren = DB::table('attendance')
->join('child', 'child.child_id', '=', 'attendance.child_id')
->select('child.child_id','child.childFirstName', 'child.childLastName','timeIn','timeOut','date')
->whereDate('date', $request->date)
->orderBy('child.childFirstName')
->get();
return view('newManualRegistration',compact('registeredChildren'));
}
For some reason Laravel ignores the required view, 'newManualRegistration', and sends the app back to the original view, 'manualRegistration' view.
I have tried using a redirect like this:
return redirect('newManualRegistration', compact('registeredChildren')); but that did not help.
So - how can I get my app to go to the correct view?
Please or to participate in this conversation.