0

I've created a from within a laravel vue component which I'm trying to submit, but I'm getting a 404 error ThoughtJournalController@store not found.

<form method="POST" action="{{ action('ThoughtJournalController@store') }}">

How do I correctly submit a form within the vue component?

2 Answers 2

0

Create a route in resources/routes/web.php:

Route::post( '/submit', 'ThoughtJournalController@store' );

Then edit your form:

<form method="POST" action="/submit">
Sign up to request clarification or add additional context in comments.

12 Comments

I'm getting an error from this: action="{{ route('storeEntry') }}": Interpolation inside attributes has been removed. Use v-bind or the colon shorthand instead. For example, instead of <div id="{{ val }}">, use <div :id="val">.
Try to type the relative path in your action. Like that: action=„submit/path“. The same path as the first attribute of Route::get()
Your form is in a *.vue file not in a *.blade.php file right?
In order to use laravel named routes in your .vue components you can use this github.com/tightenco/ziggy
Yes form in a .vue file
|
0

It seems like you forgot to Define the route did you do:

    Route::get('posts', 'ThoughtJournalController@store');

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.