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

Fropt's avatar
Level 2

PATCH request not working

Hello, I'm pretty new to Laravel. (Sort of. I just start really studying it for a week now). Anyway, I'm following https://laracasts.com/series/laravel-from-scratch-2018/episodes/12. (I know Laravel 5.7 is outdated, but I find it to be more newbie-friendly. I'll then move on to next series.).

I believe I followed everything Jeffrey said but I'm getting an error I can't solve. I have read most of the common issues on this forum, but I couldn't find a previous answer that could help me, so please excuse me for asking this (dumb) question but can anyone help me please? Thanks in advance for your time and help :)

Here is my web.php:

These are my routes: (don't know why auth:api is blank. I'll think about it later)

This is my ProjectsController.php file (most of it..)

Here is my form (edit.blade.php)

The edit page is working fine:

Until I hit that button:

Request URL: http://127.0.0.1:8000/projects/1/POST?_method=PATCH&_token=lbCOUdhmjXoAMMzA15nWAlJHG2NQegoaba5SYQqZ&title=My+First+Project+Updated&description=My+First+Project+well-writen+description.%0D%0AMy+new+line+to+be+updated. Request Method: GET Status Code: 404 Not Found Remote Address: 127.0.0.1:8000

Ain't this weird? I made a POST request and {{ method_field('PATCH') }}

Any help is very welcome! Thank you!

0 likes
7 replies
Snapey's avatar
Snapey
Best Answer
Level 122

You have two action on your form. The first should be method="POST" not action="POST"

1 like
Snapey's avatar

And you can post code here rather than images by putting 3 backticks ``` on a line before and after each code block

1 like
Tray2's avatar

You have two actions in your form

Change the one saying

action="POST"

To

method="POST"
1 like
Fropt's avatar
Level 2

@snapey THANK YOU SO MUCH!! I didn't sleep tonight thinking about this. Man, you're great and I feel so stupid.

Fropt's avatar
Level 2

@snapey Thank you again, I read an article saying you should place pictures in here. But your suggestion seems to be way clever and quicker :)

Fropt's avatar
Level 2

@tray2 Thanks TRAY2. I'm feeling pretty dumb (or blind...) :P You're correct. Thank you so much :)

Fropt's avatar
Level 2

This is just a three backtick test

 <form method="POST" action="/projects/{{ $project->id }}">

Please or to participate in this conversation.