I’m having some problems with this message" The POST method is not supported for this route. Supported methods: GET, HEAD.". I’m building a laravel + vue post app, but I’m not being able to make it work, I don’t know if I’m missing something. This is how my template (in short) looks like:
<div>
<form action="/post/create" method="POST">
</div>
My routes (just have 1):
Route::get('/post/create', [AppHttpControllersPostController::class, 'create']);
How, can I show the added tickets in the same view, it’s needed to add another route or change the get route to post?, I’m a bit new and I’m very very lost, haha.
I’m using a vue template, not a blade
3
Answers
FINALLY GOT the solution /o/, It was a problem with the csrf token in vue, I have placed the meta csrf in my root blade, and added the hidden input with the csrf and is working everything. Now I just need to show the form post info in idk, in the console, a json, or in the same page. That's a new fight but, well, I have made a great progress /o/
You have to define post method if you using method="POST"
Just change
to
This is because, you are using same route for both requests. [loading the form into DOM and posting the form] .