Eddymens (List page)

Last updated 2024-02-02 18:53:49

Old Input Helper Returns Null Or Is Empty | Laravel 10

If you end up with a null value whenever you try repopulating a form using old(), there is a high chance the inputs are not sent back to the view from the controller.

Fixing this requires a bit of debugging.

  • First dump out the inputs the user is sending to be sure they even get to the controller i.e: dd($request->input())

  • Next ensure you are sending this input back to the view.

01: //This bit goes into the controller method 02: return back()->withInput( 03: $request->except('password') 04: ); 05:

Here is another article you might like 😊 "How To Check If A User's Input Is One Of The Permitted Options During Validation | Laravel 10"