So you’d like the form input to have the previous value entered when there’s an error?
Inertia | return back() with props?
I've a page to Edit the psw (a GET request) , and an Update psw (PUT request) from the same page.
I need something like: return back->with( props) to return server-data. Laravel doc gives: return back()->withInput(); but I don't need to return browser-data [1]
If I use Inertia::render() I can return server-data, but the url will change, and if the user refresh the page (on a PUT request) they get 405 error: 405 (Method Not Allowed)
How do I fix this? It seems the only option is to save my server-data to a session(var) before I use return back() ? Thanks
Routes for Edit & Update psw:
Route::get('/profile', [ProfileController::class, 'edit'])->name('profile.edit'); // Edit GET
Route::put('password', [PasswordController::class, 'update'])->name('password.update'); // Update PUT
Response for Edit & Update
return Inertia::render('Profile/Edit', [
'status' => session('status') ]); // Edit
return Inertia::render('Profile/Edit', [
'status' => session('status'),
're_array' => $re_array ]); // Update
Please or to participate in this conversation.