Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

rxndxllx's avatar

PATCH requests hanging when running on Sail

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?

0 likes
4 replies
martinbean's avatar

@rxndxllx If you hadn’t said you were using Inertia, I’d have suggested this is because Sail uses the built-in PHP server to serve applications, which can only handle one concurrent HTTP request at a time.

Can you run say in non-detached mode (sail up) and then show what requests are being made when it hangs?

rxndxllx's avatar

@martinbean Hi, apologies for the late reply. I tried running it in detached mode but I wasn't able to get anything meaningful. It does show that it makes requests to the endpoints but nothing else before or during the request hanging.

laravel.test-1  | 2025-06-24 04:07:38 /settings/profile ............................ ~ 0.24ms
laravel.test-1  |   2025-06-24 04:08:27 /settings/profile ............................ ~ 0.53ms
laravel.test-1  |   2025-06-24 04:08:33 /settings/profile ............................ ~ 0.35ms
iddo7's avatar

I have the same problem running on Laravel Sail on macos. My friend ran the project on his windows machine, but didn't have the problem.

If this can help I found this workaround : Before:

const response = await axios.patch(url, values);

After:

const response = await axios.post(url, values, {
	headers: {
		"X-HTTP-Method-Override": "PATCH",
	},
});

However if someone can find the root cause for this problem it would be the best

rxndxllx's avatar

@iddo7 Yes, I'm also encountering this running on MacOS. Thanks for this suggestion!

Please or to participate in this conversation.