I'm using the Laravel 12 + React + Inertia starter kit. When I run the application using Sail, my PATCH requests never complete. The PATCH endpoint is being hit properly, executes the logic/DB updates, but the request gets stuck on pending forever. However, when I run the application outside of Sail, everything works just fine.
I haven't changed anything from the starter kit. Other request methods work properly.
Frontend
// profile.tsx
const submit: FormEventHandler = (e) => {
e.preventDefault();
patch(route('profile.update'), {
preserveScroll: true,
});
};
Route
// settings.php
Route::patch("settings/profile", [ProfileController::class, "update"])->name("profile.update");
Controller
// ProfileController.php
public function update(ProfileUpdateRequest $request): RedirectResponse
{
$request->user()->fill($request->validated());
if ($request->user()->isDirty('email')) {
$request->user()->email_verified_at = null;
}
$request->user()->save();
return to_route('profile.edit');
}
I want to understand this behavior and why it only occurs when I use Sail to run the application. Has anyone encountered this issue yet?