Answer the question
In order to leave comments, you need to log in
Laravel action not working?
Good afternoon, there are two forms on the page, one leads to the saveProfile method, the second to createTeam, but as soon as the second form is created, it gives an error Action App\Http\Controllers\[email protected] not defined
routes:
Route::post('/profile',[\App\Http\Controllers\ProfileController::class, 'saveProfile']);
Route::post('/profile',[\App\Http\Controllers\ProfileController::class, 'createTeam']);
<form method="POST" action="{{action('App\Http\Controllers\[email protected]') }}">
<input class="input-footer" name="team" placeholder="Название команды" type="text">
<button class="submit-btn btn--size btn--mr">Создать</button>
</form>
Answer the question
In order to leave comments, you need to log in
The routes are exactly the same. How should the router tell them apart if the path and http method are the same?
The route should be given a name and retrieved from it for the form.
Use Google Translate, Luke!
Quite clearly written - Action not defined.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question